diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-09 19:42:37 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-09 19:42:37 +0000 |
commit | c8791c1d37502f162b8616b066303bfadc4a749b (patch) | |
tree | 6843c3505117f26549dfe1dc9cd40aacd5ccdfd3 /javascript/imageviewer.js | |
parent | 6fbd85dd0c0dffc06560bff91f4c4b65e441ca5f (diff) | |
parent | 31397986e70d20e392d9c3ec70d3aef8ecc2c1ff (diff) | |
download | stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.gz stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.bz2 stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.zip |
Merge branch 'dev' into release_candidate
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); } |