aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
authoryfszzx <yfszzx@gmail.com>2022-10-16 12:34:05 +0800
committeryfszzx <yfszzx@gmail.com>2022-10-16 12:34:05 +0800
commit5d8c59eee505cf15ec6994d05bb941440d90e44e (patch)
treea87f6e38d4dc33e3f293f10f9cdd1760af93114c /javascript/ui.js
parent763b893f319cee280b86e63025eb55e7c16b02e7 (diff)
parentd41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5 (diff)
Merge branch 'master' of https://github.com/yfszzx/stable-diffusion-webui-plus
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js12
1 files changed, 1 insertions, 11 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index 0f8fe68e..9e1bed4c 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -141,7 +141,7 @@ function submit_img2img(){
function ask_for_style_name(_, prompt_text, negative_prompt_text) {
name_ = prompt('Style name:')
- return name_ === null ? [null, null, null]: [name_, prompt_text, negative_prompt_text]
+ return [name_, prompt_text, negative_prompt_text]
}
@@ -187,12 +187,10 @@ onUiUpdate(function(){
if (!txt2img_textarea) {
txt2img_textarea = gradioApp().querySelector("#txt2img_prompt > label > textarea");
txt2img_textarea?.addEventListener("input", () => update_token_counter("txt2img_token_button"));
- txt2img_textarea?.addEventListener("keyup", (event) => submit_prompt(event, "txt2img_generate"));
}
if (!img2img_textarea) {
img2img_textarea = gradioApp().querySelector("#img2img_prompt > label > textarea");
img2img_textarea?.addEventListener("input", () => update_token_counter("img2img_token_button"));
- img2img_textarea?.addEventListener("keyup", (event) => submit_prompt(event, "img2img_generate"));
}
})
@@ -220,14 +218,6 @@ function update_token_counter(button_id) {
token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time);
}
-function submit_prompt(event, generate_button_id) {
- if (event.altKey && event.keyCode === 13) {
- event.preventDefault();
- gradioApp().getElementById(generate_button_id).click();
- return;
- }
-}
-
function restart_reload(){
document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
setTimeout(function(){location.reload()},2000)