aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/imageviewer.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-19 06:43:49 +0000
committerGitHub <noreply@github.com>2022-10-19 06:43:49 +0000
commit05315d8a236e252221bbbdd9e8f459b8a31c3524 (patch)
tree0bce187060568747888571fafedca4974fe17af3 /javascript/imageviewer.js
parent9a33292ce41b01252cdb8ab6214a11d274e32fa0 (diff)
parent1d4aa376e6111e90888a30ae24d2bcd7f978ec51 (diff)
downloadstable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.tar.gz
stable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.tar.bz2
stable-diffusion-webui-gfx803-05315d8a236e252221bbbdd9e8f459b8a31c3524.zip
Merge branch 'master' into hot-reload-javascript
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)