diff options
author | pieresimakp <69743585+pieresimakp@users.noreply.github.com> | 2023-03-27 03:53:15 +0000 |
---|---|---|
committer | pieresimakp <69743585+pieresimakp@users.noreply.github.com> | 2023-03-27 03:53:15 +0000 |
commit | 68a5604cac50c27dbacf9775c9466600dc8bf789 (patch) | |
tree | e3cd120bb5321d2856ef0b51b244c3aa083e82c1 /javascript/imageviewer.js | |
parent | 774c691df8b99f5e24d3f41e451fe65f5b447952 (diff) | |
parent | 3b5a3fab91ff797b28239cda5b449aac1f85ad00 (diff) | |
download | stable-diffusion-webui-gfx803-68a5604cac50c27dbacf9775c9466600dc8bf789.tar.gz stable-diffusion-webui-gfx803-68a5604cac50c27dbacf9775c9466600dc8bf789.tar.bz2 stable-diffusion-webui-gfx803-68a5604cac50c27dbacf9775c9466600dc8bf789.zip |
Merge remote-tracking branch 'upstream/master' into pr-dev
Diffstat (limited to 'javascript/imageviewer.js')
-rw-r--r-- | javascript/imageviewer.js | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index 7547e771..d6483562 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -32,13 +32,7 @@ function negmod(n, m) { function updateOnBackgroundChange() { const modalImage = gradioApp().getElementById("modalImage") if (modalImage && modalImage.offsetParent) { - let allcurrentButtons = gradioApp().querySelectorAll(".gallery-item.transition-all.\\!ring-2") - let currentButton = null - allcurrentButtons.forEach(function(elem) { - if (elem.parentElement.offsetParent) { - currentButton = elem; - } - }) + let currentButton = selected_gallery_button(); if (currentButton?.children?.length > 0 && modalImage.src != currentButton.children[0].src) { modalImage.src = currentButton.children[0].src; @@ -50,22 +44,10 @@ function updateOnBackgroundChange() { } function modalImageSwitch(offset) { - var allgalleryButtons = gradioApp().querySelectorAll(".gradio-gallery .thumbnail-item") - var galleryButtons = [] - allgalleryButtons.forEach(function(elem) { - if (elem.parentElement.offsetParent) { - galleryButtons.push(elem); - } - }) + var galleryButtons = all_gallery_buttons(); if (galleryButtons.length > 1) { - var allcurrentButtons = gradioApp().querySelectorAll(".gradio-gallery .thumbnail-item.selected") - var currentButton = null - allcurrentButtons.forEach(function(elem) { - if (elem.parentElement.offsetParent) { - currentButton = elem; - } - }) + var currentButton = selected_gallery_button(); var result = -1 galleryButtons.forEach(function(v, i) { |