mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
Only switch between visible gallery entries
Since the other tabs are kept in the dom now filtering is needed.
This commit is contained in:
parent
e12793e937
commit
e560eb8b60
@ -22,10 +22,22 @@ function negmod(n, m) {
|
||||
}
|
||||
|
||||
function modalImageSwitch(offset){
|
||||
var galleryButtons = gradioApp().querySelectorAll(".gallery-item.transition-all")
|
||||
var allgalleryButtons = gradioApp().querySelectorAll(".gallery-item.transition-all")
|
||||
var galleryButtons = []
|
||||
allgalleryButtons.forEach(function(elem){
|
||||
if(elem.parentElement.offsetParent){
|
||||
galleryButtons.push(elem);
|
||||
}
|
||||
})
|
||||
|
||||
if(galleryButtons.length>1){
|
||||
var currentButton = gradioApp().querySelector(".gallery-item.transition-all.\\!ring-2")
|
||||
var allcurrentButtons = gradioApp().querySelectorAll(".gallery-item.transition-all.\\!ring-2")
|
||||
var currentButton = null
|
||||
allcurrentButtons.forEach(function(elem){
|
||||
if(elem.parentElement.offsetParent){
|
||||
currentButton = elem;
|
||||
}
|
||||
})
|
||||
|
||||
var result = -1
|
||||
galleryButtons.forEach(function(v, i){ if(v==currentButton) { result = i } })
|
||||
|
Loading…
Reference in New Issue
Block a user