diff options
-rw-r--r-- | src/static/client3.js | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/static/client3.js b/src/static/client3.js index 86b5f985..1e64ebe1 100644 --- a/src/static/client3.js +++ b/src/static/client3.js @@ -2015,98 +2015,6 @@ function addExternalIconTooltipPageListeners() { clientSteps.getPageReferences.push(getExternalIconTooltipReferences); clientSteps.addPageListeners.push(addExternalIconTooltipPageListeners); -/* -const linkIconTooltipInfo = - Array.from(document.querySelectorAll('span.contribution.has-tooltip')) - .map(span => ({ - mainLink: span.querySelector('a'), - iconsContainer: span.querySelector('span.icons-tooltip'), - iconLinks: span.querySelectorAll('span.icons-tooltip a'), - })); - -for (const info of linkIconTooltipInfo) { - const focusElements = - [info.mainLink, ...info.iconLinks]; - - const hoverElements = - [info.mainLink, info.iconsContainer]; - - let hidden = true; - - const show = () => { - info.iconsContainer.classList.add('visible'); - info.iconsContainer.inert = false; - hidden = false; - }; - - const hide = () => { - info.iconsContainer.classList.remove('visible'); - info.iconsContainer.inert = true; - hidden = true; - }; - - const considerHiding = () => { - if (hoverElements.some(el => el.matches(':hover'))) { - return; - } - - if (<document.activeElement is inside tooltip>) { - return; - } - - if (justTouched) { - return; - } - - hide(); - }; - - // Hover (pointer) - - let hoverTimeout; - - info.mainLink.addEventListener('mouseenter', () => { - if (hidden) { - hoverTimeout = setTimeout(show, 250); - } - }); - - info.mainLink.addEventListener('mouseout', () => { - if (hidden) { - clearTimeout(hoverTimeout); - } else { - considerHiding(); - } - }); - - info.iconsContainer.addEventListener('mouseout', () => { - if (!hidden) { - considerHiding(); - } - }); - - // Focus (keyboard) - - let focusTimeout; - - info.mainLink.addEventListener('focus', () => { - focusTimeout = setTimeout(show, 750); - }); - - info.mainLink.addEventListener('blur', () => { - clearTimeout(focusTimeout); - }); - - info.iconsContainer.addEventListener('focusout', () => { - requestAnimationFrame(considerHiding); - }); - - info.mainLink.addEventListener('blur', () => { - requestAnimationFrame(considerHiding); - }); -} -*/ - // Sticky commentary sidebar ------------------------------ const albumCommentarySidebarInfo = clientInfo.albumCommentarySidebarInfo = { |