diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2024-02-17 07:32:10 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2024-02-17 07:32:10 +0000 |
commit | db19c46d6de32878145e051d8f30ff1ef5b2227c (patch) | |
tree | 95d09cc56ad57e69dba7b4657886b2b7c344f72f /javascript | |
parent | 1466daeafc1cc9dcf0319012a6ec6129d51ebd2c (diff) | |
download | stable-diffusion-webui-gfx803-db19c46d6de32878145e051d8f30ff1ef5b2227c.tar.gz stable-diffusion-webui-gfx803-db19c46d6de32878145e051d8f30ff1ef5b2227c.tar.bz2 stable-diffusion-webui-gfx803-db19c46d6de32878145e051d8f30ff1ef5b2227c.zip |
lint
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/token-counters.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/javascript/token-counters.js b/javascript/token-counters.js index 5d53fe47..eeea7a5d 100644 --- a/javascript/token-counters.js +++ b/javascript/token-counters.js @@ -56,7 +56,7 @@ function setupTokenCounting(id, id_counter, id_button) { prompt.parentElement.style.position = "relative"; var func = onEdit(id, textarea, 800, function() { - if(counter.classList.contains("token-counter-visible")){ + if (counter.classList.contains("token-counter-visible")) { gradioApp().getElementById(id_button)?.click(); } }); @@ -68,20 +68,20 @@ function toggleTokenCountingVisibility(id, id_counter, id_button) { var counter = gradioApp().getElementById(id_counter); counter.style.display = opts.disable_token_counters ? "none" : "block"; - counter.classList.toggle("token-counter-visible", ! opts.disable_token_counters); + counter.classList.toggle("token-counter-visible", !opts.disable_token_counters); } -function runCodeForTokenCounters(fun){ +function runCodeForTokenCounters(fun) { fun('txt2img_prompt', 'txt2img_token_counter', 'txt2img_token_button'); fun('txt2img_neg_prompt', 'txt2img_negative_token_counter', 'txt2img_negative_token_button'); fun('img2img_prompt', 'img2img_token_counter', 'img2img_token_button'); fun('img2img_neg_prompt', 'img2img_negative_token_counter', 'img2img_negative_token_button'); } -onUiLoaded(function(){ +onUiLoaded(function() { runCodeForTokenCounters(setupTokenCounting); }); -onOptionsChanged(function(){ +onOptionsChanged(function() { runCodeForTokenCounters(toggleTokenCountingVisibility); }); |