« get me outta code hell

content, css, client: hoverable-tooltip: isolate z-index bullshit - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-03-31 17:46:05 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-10 16:02:37 -0300
commit60b8fd09165e0772869016f72ff2d955f0be0f2a (patch)
tree269e6fc99a1286cefdd6062afc8d297fc02d7d91 /src/static
parentec8c79787ab330986e9da590fd500c7ceda893f2 (diff)
content, css, client: hoverable-tooltip: isolate z-index bullshit
Diffstat (limited to 'src/static')
-rw-r--r--src/static/css/site.css5
-rw-r--r--src/static/js/client/hoverable-tooltip.js11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 99c7d90d..51a1f97f 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -1096,6 +1096,11 @@ a .normal-content {
   text-decoration: none !important;
 }
 
+.isolate-tooltip-z-indexing > * {
+  position: relative;
+  z-index: -1;
+}
+
 .tooltip {
   position: absolute;
   z-index: 3;
diff --git a/src/static/js/client/hoverable-tooltip.js b/src/static/js/client/hoverable-tooltip.js
index 484f2ab0..395bb51a 100644
--- a/src/static/js/client/hoverable-tooltip.js
+++ b/src/static/js/client/hoverable-tooltip.js
@@ -576,6 +576,17 @@ export function showTooltipFromHoverable(hoverable) {
 
   hoverable.classList.add('has-visible-tooltip');
 
+  const isolator =
+    hoverable.closest('.isolate-tooltip-z-indexing > *');
+
+  if (isolator) {
+    for (const child of isolator.parentElement.children) {
+      cssProp(child, 'z-index', null);
+    }
+
+    cssProp(isolator, 'z-index', '1');
+  }
+
   positionTooltipFromHoverableWithBrains(hoverable);
 
   cssProp(tooltip, 'display', 'block');