« get me outta code hell

css, client: adapt <summary> to support hoverable/tooltip - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/client/summary-nested-link.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-23 11:02:41 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-23 11:02:41 -0300
commitc6010933dc481e95e3ab1768613f767eda3ba1e3 (patch)
treea3e6c990f11be28e5d79c220d1e9cf77690c9ba8 /src/static/js/client/summary-nested-link.js
parent347b0063794a74712123d02a71f700bdcf345b6b (diff)
css, client: adapt <summary> to support hoverable/tooltip
This is the first commit where we're using :has() and nested rules.
Both of those are considered baseline December 2023, and we figure
that will be at least *about* three years ago once this update is
released.
Diffstat (limited to 'src/static/js/client/summary-nested-link.js')
-rw-r--r--src/static/js/client/summary-nested-link.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/static/js/client/summary-nested-link.js b/src/static/js/client/summary-nested-link.js
deleted file mode 100644
index 1c4e7e4b..00000000
--- a/src/static/js/client/summary-nested-link.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import {
-  empty,
-  filterMultipleArrays,
-  stitchArrays,
-} from '../../shared-util/sugar.js';
-
-export const info = {
-  id: 'summaryNestedLinkInfo',
-
-  summaries: null,
-  links: null,
-};
-
-export function getPageReferences() {
-  info.summaries =
-    Array.from(document.getElementsByTagName('summary'));
-
-  info.links =
-    info.summaries
-      .map(summary =>
-        Array.from(summary.getElementsByTagName('a')));
-
-  filterMultipleArrays(
-    info.summaries,
-    info.links,
-    (_summary, links) => !empty(links));
-}
-
-export function addPageListeners() {
-  for (const {summary, links} of stitchArrays({
-    summary: info.summaries,
-    links: info.links,
-  })) {
-    for (const link of links) {
-      link.addEventListener('mouseover', () => {
-        link.classList.add('nested-hover');
-        summary.classList.add('has-nested-hover');
-      });
-
-      link.addEventListener('mouseout', () => {
-        link.classList.remove('nested-hover');
-        summary.classList.remove('has-nested-hover');
-      });
-    }
-  }
-}