aboutsummaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorJC-Array <44535867+JC-Array@users.noreply.github.com>2022-10-11 17:33:15 -0500
committerGitHub <noreply@github.com>2022-10-11 17:33:15 -0500
commit963d98639673098fa8df975dd380f1ef56fff3b5 (patch)
tree21d41f53af03ce2b21de7947fc216784fb2f2364 /script.js
parentff4ef13dd591ec52f196f344f47537695df95364 (diff)
parent6be32b31d181e42c639dad3451229aa7b9cfd1cf (diff)
Merge branch 'AUTOMATIC1111:master' into deepdanbooru_pre_process
Diffstat (limited to 'script.js')
-rw-r--r--script.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/script.js b/script.js
index a92c0f77..9543cbe6 100644
--- a/script.js
+++ b/script.js
@@ -6,6 +6,10 @@ function get_uiCurrentTab() {
return gradioApp().querySelector('.tabs button:not(.border-transparent)')
}
+function get_uiCurrentTabContent() {
+ return gradioApp().querySelector('.tabitem[id^=tab_]:not([style*="display: none"])')
+}
+
uiUpdateCallbacks = []
uiTabChangeCallbacks = []
let uiCurrentTab = null
@@ -50,8 +54,11 @@ document.addEventListener("DOMContentLoaded", function() {
} else if (e.keyCode !== undefined) {
if((e.keyCode == 13 && (e.metaKey || e.ctrlKey))) handled = true;
}
- if (handled) {
- gradioApp().querySelector("#txt2img_generate").click();
+ if (handled) {
+ button = get_uiCurrentTabContent().querySelector('button[id$=_generate]');
+ if (button) {
+ button.click();
+ }
e.preventDefault();
}
})