diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-06-07 11:32:45 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-06-07 11:32:45 -0300 |
commit | 0e150bbdf4c384bd2eee6fe3e06ab7b4eb3563da (patch) | |
tree | f3ac6a91e4b0ddb75c81d09d2799b623789645f2 /src/static | |
parent | 05b7dc2f86b7b4e89b07cc54f53e851fe11e0e1a (diff) |
content: generatePageLayout: image overlay container
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/client.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/static/client.js b/src/static/client.js index 35ef82ee..62122952 100644 --- a/src/static/client.js +++ b/src/static/client.js @@ -645,11 +645,17 @@ updateStickyHeading(); // Image overlay ------------------------------------------ function addImageOverlayClickHandlers() { + const container = document.getElementById('image-overlay-container'); + + if (!container) { + console.warn(`#image-overlay-container missing, image overlay module disabled.`); + return; + } + for (const img of document.querySelectorAll('.image-link')) { img.addEventListener('click', handleImageLinkClicked); } - const container = document.getElementById('image-overlay-container'); const actionContainer = document.getElementById('image-overlay-action-container'); container.addEventListener('click', handleContainerClicked); |