« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateStickyHeadingContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateStickyHeadingContainer.js')
-rw-r--r--src/content/dependencies/generateStickyHeadingContainer.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js
index f58b0cd8..f7388d60 100644
--- a/src/content/dependencies/generateStickyHeadingContainer.js
+++ b/src/content/dependencies/generateStickyHeadingContainer.js
@@ -1,7 +1,10 @@
 export default {
-  extraDependencies: ['html'],
-
   slots: {
+    rootAttributes: {
+      type: 'attributes',
+      mutable: false,
+    },
+
     title: {
       type: 'html',
       mutable: false,
@@ -15,6 +18,8 @@ export default {
 
   generate: (slots, {html}) => html.tags([
     html.tag('div', {class: 'content-sticky-heading-root'},
+      slots.rootAttributes,
+
       !html.isBlank(slots.cover) &&
         {class: 'has-cover'},
 
@@ -26,12 +31,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'},
@@ -48,10 +53,5 @@ export default {
             html.tag('div', {class: 'content-sticky-subheading-row'},
               html.tag('h2', {class: 'content-sticky-subheading'})),
           ]))),
-
-    html.tag('h1', {class: 'imaginary-static-heading-root'},
-      html.tag('span', {class: 'imaginary-static-heading-row'},
-        html.tag('span', {class: 'imaginary-static-heading-title'},
-          slots.title.clone()))),
   ]),
 };