« get me outta code hell

static, css: define tooltip show/hide 100% in JS - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-26 19:53:45 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-26 19:57:06 -0400
commit57c06ea665cf2c2ee4536cab70b2459457d05e15 (patch)
treefe7478e2cc74fc1f80499ee9d509eabd6a26ee7b
parent511a26ddff981b866e7ccb6ecb0724c0a67d097e (diff)
static, css: define tooltip show/hide 100% in JS
-rw-r--r--src/static/client3.js5
-rw-r--r--src/static/site6.css3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/static/client3.js b/src/static/client3.js
index 58687ecc..a55361ce 100644
--- a/src/static/client3.js
+++ b/src/static/client3.js
@@ -847,11 +847,11 @@ function hideCurrentlyShownTooltip(intendingToReplace = false) {
   // apparent in the interaction, and should be hidden with a transition.
   if (intendingToReplace) {
     cancelTransitioningTooltipHidden();
+    cssProp(tooltip, 'display', 'none');
   } else {
     beginTransitioningTooltipHidden(state.currentlyShownTooltip);
   }
 
-  tooltip.classList.remove('visible');
   tooltip.inert = true;
 
   state.currentlyShownTooltip = null;
@@ -879,7 +879,8 @@ function showTooltipFromHoverable(hoverable) {
   }
 
   hoverable.classList.add('has-visible-tooltip');
-  tooltip.classList.add('visible');
+
+  cssProp(tooltip, 'display', 'block');
   tooltip.inert = false;
 
   state.currentlyShownTooltip = tooltip;
diff --git a/src/static/site6.css b/src/static/site6.css
index 830e32f2..76b58f32 100644
--- a/src/static/site6.css
+++ b/src/static/site6.css
@@ -498,9 +498,6 @@ a:not([href]):hover {
   left: -34px;
   top: calc(1em + 1px);
   padding: 3px 6px 6px 6px;
-}
-
-.icons-tooltip:not(.visible) {
   display: none;
 }