fix: quote button staying on screen on slow computers

isekai-main
Baris Usakli 3 years ago
parent 2c08a2b3bd
commit d378bf4c9c

@ -483,6 +483,11 @@ define('forum/topic/postTools', [
setTimeout(async function () {
let selectionTooltip = $('[component="selection/tooltip"]');
selectionTooltip.addClass('hidden');
if (selectionTooltip.attr('data-ajaxify') === '1') {
selectionTooltip.remove();
return;
}
const selection = window.getSelection();
if (selection.focusNode && selection.type === 'Range' && ajaxify.data.template.topic && !selectionEmpty) {
const focusNode = $(selection.focusNode);
@ -510,7 +515,7 @@ define('forum/topic/postTools', [
});
selectionTooltip.removeClass('hidden');
$(window).one('action:ajaxify.start', function () {
selectionTooltip.remove();
selectionTooltip.attr('data-ajaxify', 1).addClass('hidden');
$(document).off('selectionchange', selectionChange);
});
const tooltipWidth = selectionTooltip.outerWidth(true);

Loading…
Cancel
Save