aboutsummaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authormissionfloyd <missionfloyd@users.noreply.github.com>2023-03-26 21:47:05 -0600
committermissionfloyd <missionfloyd@users.noreply.github.com>2023-03-26 21:47:05 -0600
commitefac2cf1ab6645f3f5134158c1401c6305c2ffea (patch)
tree24b69e980c07d03618a6e5b2447704cdb30a6a20 /script.js
parent1d096ed1456c9b9b662477839853621848705e68 (diff)
parenta336c7fe233fa7dff062f5187c0f4d01ab26e80b (diff)
Merge branch 'extra-network-preview-lazyload' of https://github.com/missionfloyd/stable-diffusion-webui into extra-network-preview-lazyload
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() {