aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/imageviewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/imageviewer.js')
-rw-r--r--javascript/imageviewer.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js
index 65a33dd7..9e380c65 100644
--- a/javascript/imageviewer.js
+++ b/javascript/imageviewer.js
@@ -31,7 +31,7 @@ function updateOnBackgroundChange() {
}
})
- if (modalImage.src != currentButton.children[0].src) {
+ if (currentButton?.children?.length > 0 && modalImage.src != currentButton.children[0].src) {
modalImage.src = currentButton.children[0].src;
if (modalImage.style.display === 'none') {
modal.style.setProperty('background-image', `url(${modalImage.src})`)
@@ -116,6 +116,7 @@ function showGalleryImage() {
e.dataset.modded = true;
if(e && e.parentElement.tagName == 'DIV'){
e.style.cursor='pointer'
+ e.style.userSelect='none'
e.addEventListener('click', function (evt) {
if(!opts.js_modal_lightbox) return;
modalZoomSet(gradioApp().getElementById('modalImage'), opts.js_modal_lightbox_initially_zoomed)