diff options
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); |