From 9fa31db2077ff14baac73c89b265ed1aae18285e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Sep 2024 00:16:09 +0300 Subject: [PATCH] client: Fix another case of tooltip overlap --- src/public/app/services/note_tooltip.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/public/app/services/note_tooltip.js b/src/public/app/services/note_tooltip.js index f6a7dbfdd..3aecc7d8e 100644 --- a/src/public/app/services/note_tooltip.js +++ b/src/public/app/services/note_tooltip.js @@ -16,7 +16,7 @@ function setupGlobalTooltip() { return; } - cleanUpTooltips; + cleanUpTooltips(); }); } @@ -94,7 +94,7 @@ async function mouseEnterHandler() { // Dismiss the tooltip immediately if a link was clicked inside the tooltip. $(`.${tooltipClass} a`).on("click", (e) => { - $(this).tooltip('dispose'); + cleanUpTooltips(); }); // the purpose of the code below is to: @@ -102,15 +102,9 @@ async function mouseEnterHandler() { // click on links within tooltip etc. without tooltip disappearing // - once the user moves the cursor away from both link and the tooltip, hide the tooltip const checkTooltip = () => { - if (!$(`.${tooltipClass}`).is(':visible')) { - console.log("Not visible anymore"); - - return; - } - if (!$(this).filter(":hover").length && !$(`.${linkId}:hover`).length) { // cursor is neither over the link nor over the tooltip, user likely is not interested - $(this).tooltip('dispose'); + cleanUpTooltips(); } else { setTimeout(checkTooltip, 1000); }