aboutsummaryrefslogtreecommitdiffstats
path: root/script.js
diff options
context:
space:
mode:
authord8ahazard <d8ahazard@gmail.com>2022-09-27 16:02:41 +0000
committerd8ahazard <d8ahazard@gmail.com>2022-09-27 16:02:41 +0000
commit5756d517a6342d8a9ffa3ead636dcb84b463d2e3 (patch)
tree6feb5e799520b66aa65f09f7dbb352f4e3813a60 /script.js
parent11875f586323cea7c5b8398976449788a83dee76 (diff)
parentada901ed661a717c44281d640b8fc0a275d4cb48 (diff)
downloadstable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.tar.gz
stable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.tar.bz2
stable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.zip
Merge remote-tracking branch 'upstream/master' into ModelLoader
Diffstat (limited to 'script.js')
-rw-r--r--script.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/script.js b/script.js
index 7f26e23b..cf989605 100644
--- a/script.js
+++ b/script.js
@@ -39,3 +39,24 @@ document.addEventListener("DOMContentLoaded", function() {
});
mutationObserver.observe( gradioApp(), { childList:true, subtree:true })
});
+
+/**
+ * checks that a UI element is not in another hidden element or tab content
+ */
+function uiElementIsVisible(el) {
+ let isVisible = !el.closest('.\\!hidden');
+ if ( ! isVisible ) {
+ return false;
+ }
+
+ while( isVisible = el.closest('.tabitem')?.style.display !== 'none' ) {
+ if ( ! isVisible ) {
+ return false;
+ } else if ( el.parentElement ) {
+ el = el.parentElement
+ } else {
+ break;
+ }
+ }
+ return isVisible;
+} \ No newline at end of file