From c6010933dc481e95e3ab1768613f767eda3ba1e3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 23 May 2026 11:02:41 -0300 Subject: css, client: adapt 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. --- src/static/js/client/index.js | 2 -- src/static/js/client/summary-nested-link.js | 46 ----------------------------- 2 files changed, 48 deletions(-) delete mode 100644 src/static/js/client/summary-nested-link.js (limited to 'src/static/js/client') diff --git a/src/static/js/client/index.js b/src/static/js/client/index.js index 9296dff1..6862b4ad 100644 --- a/src/static/js/client/index.js +++ b/src/static/js/client/index.js @@ -22,7 +22,6 @@ import * as revealAllGridControlModule from './reveal-all-grid-control.js'; import * as scriptedLinkModule from './scripted-link.js'; import * as sidebarSearchModule from './sidebar-search.js'; import * as stickyHeadingModule from './sticky-heading.js'; -import * as summaryNestedLinkModule from './summary-nested-link.js'; import * as textWithTooltipModule from './text-with-tooltip.js'; import * as wikiSearchModule from './wiki-search.js'; @@ -49,7 +48,6 @@ export const modules = [ scriptedLinkModule, sidebarSearchModule, stickyHeadingModule, - summaryNestedLinkModule, textWithTooltipModule, wikiSearchModule, ]; 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'); - }); - } - } -} -- cgit 1.3.0-6-gf8a5