« get me outta code hell

client: hide missing cover image from sticky heading - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/client2.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-11 15:12:13 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-11 15:12:13 -0300
commit8a23eb5888242d6243eb6954d7d68622c24bdbcd (patch)
tree86814bd392bee4dd92c7f0920fd5cd95e318b6f3 /src/static/client2.js
parenta88d346f9e7c2c9b01795c10761a5ec698e88f94 (diff)
client: hide missing cover image from sticky heading
Diffstat (limited to 'src/static/client2.js')
-rw-r--r--src/static/client2.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/static/client2.js b/src/static/client2.js
index 8ae9876..7897041 100644
--- a/src/static/client2.js
+++ b/src/static/client2.js
@@ -534,11 +534,17 @@ const stickyHeadingInfo = Array.from(document.querySelectorAll('.content-sticky-
     const {parentElement: contentContainer} = stickyContainer;
     const stickySubheadingRow = stickyContainer.querySelector('.content-sticky-subheading-row');
     const stickySubheading = stickySubheadingRow.querySelector('h2');
-    const stickyCoverContainer = stickyContainer.querySelector('.content-sticky-heading-cover-container');
-    const stickyCover = stickyCoverContainer?.querySelector('.content-sticky-heading-cover');
+    let stickyCoverContainer = stickyContainer.querySelector('.content-sticky-heading-cover-container');
+    let stickyCover = stickyCoverContainer?.querySelector('.content-sticky-heading-cover');
     const contentHeadings = Array.from(contentContainer.querySelectorAll('.content-heading'));
     const contentCover = contentContainer.querySelector('#cover-art-container');
 
+    if (stickyCover.querySelector('.image-text-area')) {
+      stickyCoverContainer.remove();
+      stickyCoverContainer = null;
+      stickyCover = null;
+    }
+
     return {
       contentContainer,
       contentCover,