From fec7ebed043edd692f231a25634b287429cd758d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 20 Oct 2021 20:31:27 -0400 Subject: [PATCH] fix: tooltip --- public/src/client/topic/postTools.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index 6aec899db7..6100a6a7af 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -486,7 +486,7 @@ define('forum/topic/postTools', [ if (!selectionTooltip.length) { selectionTooltip = await app.parseAndTranslate('partials/topic/selection-tooltip', ajaxify.data); - selectionTooltip.appendTo('body'); + selectionTooltip.addClass('hidden').appendTo('body'); } selectionTooltip.off('click').on('click', '[component="selection/tooltip/quote"]', function () { selectionTooltip.addClass('hidden'); @@ -509,14 +509,10 @@ define('forum/topic/postTools', [ hooks.onPage('action:posts.loaded', function () { setTimeout(updateTooltip, 0); }); - $(document).off('selectionchange', hideTooltip).on('selectionchange', hideTooltip); - postContainer.on('mouseup', updateTooltip); - } - function hideTooltip() { - if (ajaxify.data.template.topic) { - $('[component="selection/tooltip"]').addClass('hidden'); - } + postContainer.on('mouseup', function () { + setTimeout(updateTooltip, 0); + }); } return PostTools;