diff --git a/web/js/textHighlight.js b/web/js/textHighlight.js index 61a310e..12b1cd2 100644 --- a/web/js/textHighlight.js +++ b/web/js/textHighlight.js @@ -281,17 +281,9 @@ let currentTooltipRequest = null; async function showTagTooltip(element, tag) { // Create a cancellation token for this request - const requestId = Symbol('tooltip-request'); + const requestId = Symbol("tooltip-request"); currentTooltipRequest = requestId; - const description = - (await booruApi.getTagDescription(tag)) ?? "No description available."; - - // Check if this request was cancelled while we were fetching - if (currentTooltipRequest !== requestId) { - return; - } - let tooltip = document.getElementById("tag-tooltip"); if (!tooltip) { tooltip = document.createElement("div"); @@ -316,6 +308,30 @@ async function showTagTooltip(element, tag) { tooltip.style.left = `${rect.left}px`; tooltip.style.top = `${rect.bottom + 5}px`; + // Initially set content to loading + tooltip.innerHTML = "