« get me outta code hell

static: image-overlay: details via <a>, data-embed-src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-03-20 17:05:58 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-03-20 17:05:58 -0300
commit1c9025249e371869dda5fcd2f81fc104c0b3208f (patch)
tree3f2117f860208a02e979ef038734a2cd5adc5e2e
parent684ab7b1fdbb0f56fc15460eb6308b028723a727 (diff)
static: image-overlay: details via <a>, data-embed-src
-rw-r--r--src/static/js/client/image-overlay.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/static/js/client/image-overlay.js b/src/static/js/client/image-overlay.js
index 1e0ebd75..6d71165d 100644
--- a/src/static/js/client/image-overlay.js
+++ b/src/static/js/client/image-overlay.js
@@ -141,13 +141,18 @@ function getImageLinkDetails(imageLink) {
       a.href,
 
     embeddedSrc:
-      img.src,
+      img?.src ??
+      a.dataset.embedSrc,
 
     originalFileSize:
-      img.dataset.originalSize,
+      img?.dataset.originalSize ??
+      a.dataset.originalSize ??
+      null,
 
     availableThumbList:
-      img.dataset.thumbs,
+      img?.dataset.thumbs ??
+      a.dataset.thumbs ??
+      null,
 
     color:
       cssProp(imageLink, '--primary-color'),