« get me outta code hell

content, client: memorable details, collapsed crediting/ref sources - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/client/sticky-heading.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-10-06 15:23:25 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-10-06 15:23:25 -0300
commit6a99486d361b1fb8af6be08cb9c1adbbcd0b0e8f (patch)
tree21e457e2a3b168c6e257c8f5209aef3be89ad508 /src/static/js/client/sticky-heading.js
parentf820d83e94cf014e34857c69598261680c72329c (diff)
content, client: memorable details, collapsed crediting/ref sources preview
Diffstat (limited to 'src/static/js/client/sticky-heading.js')
-rw-r--r--src/static/js/client/sticky-heading.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/static/js/client/sticky-heading.js b/src/static/js/client/sticky-heading.js
index b65574d0..4660013a 100644
--- a/src/static/js/client/sticky-heading.js
+++ b/src/static/js/client/sticky-heading.js
@@ -256,6 +256,10 @@ function getContentHeadingClosestToStickySubheading(index) {
   // Iterate from bottom to top of the content area.
   const contentHeadings = info.contentHeadings[index];
   for (const heading of contentHeadings.slice().reverse()) {
+    if (heading.nodeName === 'SUMMARY' && !heading.closest('details').open) {
+      continue;
+    }
+
     const headingRect = heading.getBoundingClientRect();
     if (headingRect.y + headingRect.height / 1.5 < stickyBottom + 40) {
       return heading;