aboutsummaryrefslogtreecommitdiffstats
path: root/script.js
diff options
context:
space:
mode:
authormissionfloyd <missionfloyd@users.noreply.github.com>2023-03-25 20:51:25 +0000
committerGitHub <noreply@github.com>2023-03-25 20:51:25 +0000
commit6f18c9b13f06112d6afe9be062fe5308767ea38a (patch)
treed82ea08976ca2b5793f449094308aca3c9629099 /script.js
parent575c17a8f9bc6471a7a0891b665ec42073a18049 (diff)
parenta0d07fb5807ad55c8ccfdfc9a6d9ae3c62b9d211 (diff)
downloadstable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.tar.gz
stable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.tar.bz2
stable-diffusion-webui-gfx803-6f18c9b13f06112d6afe9be062fe5308767ea38a.zip
Merge branch 'master' into extra-networks-toggle
Diffstat (limited to 'script.js')
-rw-r--r--script.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/script.js b/script.js
index 97e0bfcf..1b9a443f 100644
--- a/script.js
+++ b/script.js
@@ -1,7 +1,9 @@
function gradioApp() {
const elems = document.getElementsByTagName('gradio-app')
- const gradioShadowRoot = elems.length == 0 ? null : elems[0].shadowRoot
- return !!gradioShadowRoot ? gradioShadowRoot : document;
+ const elem = elems.length == 0 ? document : elems[0]
+
+ if (elem !== document) elem.getElementById = function(id){ return document.getElementById(id) }
+ return elem.shadowRoot ? elem.shadowRoot : elem
}
function get_uiCurrentTab() {