« get me outta code hell

content, client: additional-names-box: integrate more neatly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-04-06 11:52:26 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-06 11:52:26 -0300
commitae14f6844b66a46d153c69ca05538d144e8a4509 (patch)
tree2ed6afd0a2393c79805dd710bd2ebd729c9da516 /src
parent50d0b505af8ed2038dc0f6ee01b8ba04b04310eb (diff)
content, client: additional-names-box: integrate more neatly
Since we're checking for [inert] ancestor anyway, we don't need
to depend on BS "first matched by querySelector()" logic anymore
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateStickyHeadingContainer.js8
-rw-r--r--src/static/js/client/additional-names-box.js6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js
index 64becc5e..ec3062a3 100644
--- a/src/content/dependencies/generateStickyHeadingContainer.js
+++ b/src/content/dependencies/generateStickyHeadingContainer.js
@@ -33,12 +33,12 @@ export default {
           [
             html.tag('div', {class: 'content-sticky-heading-row'}, [
               html.tag('h1', [
-                slots.title,
-
-                // Placement after generally keeps the contents from being
-                // the first, when matched by .querySelector() calls.
                 html.tag('span', {class: 'reference-collapsed-heading'},
+                  {inert: true},
+
                   slots.title.clone()),
+
+                slots.title,
               ]),
 
               html.tag('div', {class: 'content-sticky-heading-cover-container'},
diff --git a/src/static/js/client/additional-names-box.js b/src/static/js/client/additional-names-box.js
index da1467ec..38e6d52f 100644
--- a/src/static/js/client/additional-names-box.js
+++ b/src/static/js/client/additional-names-box.js
@@ -30,8 +30,10 @@ export function getPageReferences() {
 
   info.stickyHeadingLink =
     document.querySelector(
-      '.content-sticky-heading-container ' +
-      'a[href="#additional-names-box"]');
+      '.content-sticky-heading-container' +
+      ' ' +
+      'a[href="#additional-names-box"]' +
+      ':not(:matches([inert] *))');
 
   info.contentContainer =
     document.querySelector('#content');