mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: quote button staying on screen on slow computers
This commit is contained in:
@@ -483,6 +483,11 @@ define('forum/topic/postTools', [
|
|||||||
setTimeout(async function () {
|
setTimeout(async function () {
|
||||||
let selectionTooltip = $('[component="selection/tooltip"]');
|
let selectionTooltip = $('[component="selection/tooltip"]');
|
||||||
selectionTooltip.addClass('hidden');
|
selectionTooltip.addClass('hidden');
|
||||||
|
if (selectionTooltip.attr('data-ajaxify') === '1') {
|
||||||
|
selectionTooltip.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const selection = window.getSelection();
|
const selection = window.getSelection();
|
||||||
if (selection.focusNode && selection.type === 'Range' && ajaxify.data.template.topic && !selectionEmpty) {
|
if (selection.focusNode && selection.type === 'Range' && ajaxify.data.template.topic && !selectionEmpty) {
|
||||||
const focusNode = $(selection.focusNode);
|
const focusNode = $(selection.focusNode);
|
||||||
@@ -510,7 +515,7 @@ define('forum/topic/postTools', [
|
|||||||
});
|
});
|
||||||
selectionTooltip.removeClass('hidden');
|
selectionTooltip.removeClass('hidden');
|
||||||
$(window).one('action:ajaxify.start', function () {
|
$(window).one('action:ajaxify.start', function () {
|
||||||
selectionTooltip.remove();
|
selectionTooltip.attr('data-ajaxify', 1).addClass('hidden');
|
||||||
$(document).off('selectionchange', selectionChange);
|
$(document).off('selectionchange', selectionChange);
|
||||||
});
|
});
|
||||||
const tooltipWidth = selectionTooltip.outerWidth(true);
|
const tooltipWidth = selectionTooltip.outerWidth(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user