diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-01 11:39:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 11:39:52 +0000 |
commit | 696c338ee2841830fd5010427d90347329d5786a (patch) | |
tree | 6f9c37f302e6bcaf1ce3e1f1913f2db54f3b184e /javascript/imageviewer.js | |
parent | b463b8a12672e010a8c86ea1c73b2c14ae5555d5 (diff) | |
parent | 50f63e22472dd532ddd76adb28f29aef46a71a86 (diff) | |
download | stable-diffusion-webui-gfx803-696c338ee2841830fd5010427d90347329d5786a.tar.gz stable-diffusion-webui-gfx803-696c338ee2841830fd5010427d90347329d5786a.tar.bz2 stable-diffusion-webui-gfx803-696c338ee2841830fd5010427d90347329d5786a.zip |
Merge pull request #9953 from akx/js-misc-fixes
Miscellaneous JS fixes
Diffstat (limited to 'javascript/imageviewer.js')
-rw-r--r-- | javascript/imageviewer.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index 3deffa9b..32066ab8 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -57,7 +57,7 @@ function modalImageSwitch(offset) { }) if (result != -1) { - nextButton = galleryButtons[negmod((result + offset), galleryButtons.length)] + var nextButton = galleryButtons[negmod((result + offset), galleryButtons.length)] nextButton.click() const modalImage = gradioApp().getElementById("modalImage"); const modal = gradioApp().getElementById("lightboxModal"); @@ -144,15 +144,11 @@ function setupImageForLightbox(e) { } function modalZoomSet(modalImage, enable) { - if (enable) { - modalImage.classList.add('modalImageFullscreen'); - } else { - modalImage.classList.remove('modalImageFullscreen'); - } + if(modalImage) modalImage.classList.toggle('modalImageFullscreen', !!enable); } function modalZoomToggle(event) { - modalImage = gradioApp().getElementById("modalImage"); + var modalImage = gradioApp().getElementById("modalImage"); modalZoomSet(modalImage, !modalImage.classList.contains('modalImageFullscreen')) event.stopPropagation() } @@ -179,7 +175,7 @@ function galleryImageHandler(e) { } onUiUpdate(function() { - fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > div > img') + var fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > div > img') if (fullImg_preview != null) { fullImg_preview.forEach(setupImageForLightbox); } |