diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-10 05:10:54 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-10 05:10:54 +0000 |
commit | 022bc97c2775af882c3c7b4614e8fa85c05c6e95 (patch) | |
tree | 575ddf7874f126ca7edc9c6787556e02c0aff12d /script.js | |
parent | 1fcb48347d2a738dad9562d4d6f07fb633a3a1b9 (diff) | |
download | stable-diffusion-webui-gfx803-022bc97c2775af882c3c7b4614e8fa85c05c6e95.tar.gz stable-diffusion-webui-gfx803-022bc97c2775af882c3c7b4614e8fa85c05c6e95.tar.bz2 stable-diffusion-webui-gfx803-022bc97c2775af882c3c7b4614e8fa85c05c6e95.zip |
update for code that was supposed to be hiding mask for the gradio bug but isn't.
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -110,7 +110,6 @@ function addTitles(root){ } tabNames = {"txt2img": 1, "img2img": 1, "Extras": 1, "PNG Info": 1, "Settings": 1} -processedTabs = {} document.addEventListener("DOMContentLoaded", function() { 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 gradioApp().querySelectorAll('button').forEach(function(button){ title = button.textContent.trim() - if(processedTabs[title]) return if(tabNames[button.textContent.trim()]==null) return; - processedTabs[title]=1 - button.onclick = function(){ - mask_buttons = gradioApp().querySelectorAll('#img2maskimg button'); - if(mask_buttons.length == 2){ - mask_buttons[1].click(); + if(button.onclick == null){ + button.onclick = function(){ + console.log("hiding mask") + mask_buttons = gradioApp().querySelectorAll('#img2maskimg button'); + if(mask_buttons.length == 2){ + mask_buttons[1].click(); + } } } + }) }); mutationObserver.observe( gradioApp(), { childList:true, subtree:true }) |