mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
update for code that was supposed to be hiding mask for the gradio bug but isn't.
This commit is contained in:
parent
1fcb48347d
commit
022bc97c27
@ -110,7 +110,6 @@ function addTitles(root){
|
|||||||
}
|
}
|
||||||
|
|
||||||
tabNames = {"txt2img": 1, "img2img": 1, "Extras": 1, "PNG Info": 1, "Settings": 1}
|
tabNames = {"txt2img": 1, "img2img": 1, "Extras": 1, "PNG Info": 1, "Settings": 1}
|
||||||
processedTabs = {}
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
var mutationObserver = new MutationObserver(function(m){
|
var mutationObserver = new MutationObserver(function(m){
|
||||||
@ -119,16 +118,18 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
// fix for gradio breaking when you switch away from tab with mask
|
// fix for gradio breaking when you switch away from tab with mask
|
||||||
gradioApp().querySelectorAll('button').forEach(function(button){
|
gradioApp().querySelectorAll('button').forEach(function(button){
|
||||||
title = button.textContent.trim()
|
title = button.textContent.trim()
|
||||||
if(processedTabs[title]) return
|
|
||||||
if(tabNames[button.textContent.trim()]==null) return;
|
if(tabNames[button.textContent.trim()]==null) return;
|
||||||
processedTabs[title]=1
|
|
||||||
|
|
||||||
|
if(button.onclick == null){
|
||||||
button.onclick = function(){
|
button.onclick = function(){
|
||||||
|
console.log("hiding mask")
|
||||||
mask_buttons = gradioApp().querySelectorAll('#img2maskimg button');
|
mask_buttons = gradioApp().querySelectorAll('#img2maskimg button');
|
||||||
if(mask_buttons.length == 2){
|
if(mask_buttons.length == 2){
|
||||||
mask_buttons[1].click();
|
mask_buttons[1].click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
mutationObserver.observe( gradioApp(), { childList:true, subtree:true })
|
mutationObserver.observe( gradioApp(), { childList:true, subtree:true })
|
||||||
|
Loading…
Reference in New Issue
Block a user