generalise to work on all non-masked images on all tabs
This commit is contained in:
parent
a66d857345
commit
1ef79f926e
1 changed files with 12 additions and 11 deletions
23
script.js
23
script.js
|
@ -105,6 +105,12 @@ function showGalleryImage(){
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function galleryImageHandler(e){
|
||||||
|
if(e && e.parentElement.tagName == 'BUTTON'){
|
||||||
|
e.onclick = showGalleryImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function addTitles(root){
|
function addTitles(root){
|
||||||
root.querySelectorAll('span, button, select').forEach(function(span){
|
root.querySelectorAll('span, button, select').forEach(function(span){
|
||||||
tooltip = titles[span.textContent];
|
tooltip = titles[span.textContent];
|
||||||
|
@ -147,22 +153,17 @@ function addTitles(root){
|
||||||
img2img_preview.style.height = img2img_gallery.clientHeight + "px"
|
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)
|
window.setTimeout(requestProgress, 500)
|
||||||
});
|
});
|
||||||
mutationObserver.observe( progressbar, { childList:true, subtree:true })
|
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() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
|
Loading…
Reference in a new issue