diff options
author | 不会画画的中医不是好程序员 <yfszzx@gmail.com> | 2022-10-16 02:04:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-16 02:04:05 +0000 |
commit | d41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5 (patch) | |
tree | da39175c109598f17e89fafe57aac9b9597ff616 /javascript/ui.js | |
parent | 6e4f5566b58e36aede83427df6c69eba8517af28 (diff) | |
parent | be1596ce30b1ead6998da0c62003003dcce5eb2c (diff) | |
download | stable-diffusion-webui-gfx803-d41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5.tar.gz stable-diffusion-webui-gfx803-d41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5.tar.bz2 stable-diffusion-webui-gfx803-d41ac174e24e1e7cdcf7b42f2a03cbc6394eb5e5.zip |
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'javascript/ui.js')
-rw-r--r-- | javascript/ui.js | 12 |
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) |