diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-09-17 02:26:47 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-09-17 11:56:11 +0000 |
commit | 1ef79f926e6314b3ef9308b12ff7ad482afd790a (patch) | |
tree | 39d93f86cd97f90c9b78b60ae2271f7a84468f19 /script.js | |
parent | a66d857345c090674430c21fba1256c76d769635 (diff) | |
download | stable-diffusion-webui-gfx803-1ef79f926e6314b3ef9308b12ff7ad482afd790a.tar.gz stable-diffusion-webui-gfx803-1ef79f926e6314b3ef9308b12ff7ad482afd790a.tar.bz2 stable-diffusion-webui-gfx803-1ef79f926e6314b3ef9308b12ff7ad482afd790a.zip |
generalise to work on all non-masked images on all tabs
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -105,6 +105,12 @@ function showGalleryImage(){ }, 100); } +function galleryImageHandler(e){ + if(e && e.parentElement.tagName == 'BUTTON'){ + e.onclick = showGalleryImage; + } +} + function addTitles(root){ root.querySelectorAll('span, button, select').forEach(function(span){ tooltip = titles[span.textContent]; @@ -147,22 +153,17 @@ function addTitles(root){ img2img_preview.style.height = img2img_gallery.clientHeight + "px" } - fullImg_preview = gradioApp().querySelectorAll('img.w-full') - - if(fullImg_preview != null){ - - fullImg_preview.forEach(function function_name(e) { - if(e && e.parentElement.tagName == 'BUTTON'){ - e.onclick = showGalleryImage; - } - }); - } - window.setTimeout(requestProgress, 500) }); mutationObserver.observe( progressbar, { childList:true, subtree:true }) } + + fullImg_preview = gradioApp().querySelectorAll('img.w-full') + if(fullImg_preview != null){ + fullImg_preview.forEach(galleryImageHandler); + } + } document.addEventListener("DOMContentLoaded", function() { |