@@ -56,7 +56,7 @@ function setupTokenCounting(id, id_counter, id_button) {
5656 prompt . parentElement . style . position = "relative" ;
5757
5858 var func = onEdit ( id , textarea , 800 , function ( ) {
59- if ( counter . classList . contains ( "token-counter-visible" ) ) {
59+ if ( counter . classList . contains ( "token-counter-visible" ) ) {
6060 gradioApp ( ) . getElementById ( id_button ) ?. click ( ) ;
6161 }
6262 } ) ;
@@ -68,20 +68,20 @@ function toggleTokenCountingVisibility(id, id_counter, id_button) {
6868 var counter = gradioApp ( ) . getElementById ( id_counter ) ;
6969
7070 counter . style . display = opts . disable_token_counters ? "none" : "block" ;
71- counter . classList . toggle ( "token-counter-visible" , ! opts . disable_token_counters ) ;
71+ counter . classList . toggle ( "token-counter-visible" , ! opts . disable_token_counters ) ;
7272}
7373
74- function runCodeForTokenCounters ( fun ) {
74+ function runCodeForTokenCounters ( fun ) {
7575 fun ( 'txt2img_prompt' , 'txt2img_token_counter' , 'txt2img_token_button' ) ;
7676 fun ( 'txt2img_neg_prompt' , 'txt2img_negative_token_counter' , 'txt2img_negative_token_button' ) ;
7777 fun ( 'img2img_prompt' , 'img2img_token_counter' , 'img2img_token_button' ) ;
7878 fun ( 'img2img_neg_prompt' , 'img2img_negative_token_counter' , 'img2img_negative_token_button' ) ;
7979}
8080
81- onUiLoaded ( function ( ) {
81+ onUiLoaded ( function ( ) {
8282 runCodeForTokenCounters ( setupTokenCounting ) ;
8383} ) ;
8484
85- onOptionsChanged ( function ( ) {
85+ onOptionsChanged ( function ( ) {
8686 runCodeForTokenCounters ( toggleTokenCountingVisibility ) ;
8787} ) ;
0 commit comments