File tree 1 file changed +24
-4
lines changed
1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -590,10 +590,30 @@ function updateWordsMargin(): void {
590
590
if ( Config . tapeMode !== "off" ) {
591
591
void scrollTape ( ) ;
592
592
} else {
593
- setTimeout ( ( ) => {
594
- $ ( "#words" ) . css ( "margin-left" , "unset" ) ;
595
- $ ( "#words .afterNewline" ) . css ( "margin-left" , "unset" ) ;
596
- } , 0 ) ;
593
+ const wordsEl = document . getElementById ( "words" ) as HTMLElement ;
594
+ const afterNewlineEls =
595
+ wordsEl . querySelectorAll < HTMLElement > ( ".afterNewline" ) ;
596
+ if ( Config . smoothLineScroll ) {
597
+ const jqWords = $ ( wordsEl ) ;
598
+ jqWords . stop ( "leftMargin" , true , false ) . animate (
599
+ {
600
+ marginLeft : 0 ,
601
+ } ,
602
+ {
603
+ duration : SlowTimer . get ( ) ? 0 : 125 ,
604
+ queue : "leftMargin" ,
605
+ }
606
+ ) ;
607
+ jqWords . dequeue ( "leftMargin" ) ;
608
+ $ ( afterNewlineEls )
609
+ . stop ( true , false )
610
+ . animate ( { marginLeft : 0 } , SlowTimer . get ( ) ? 0 : 125 ) ;
611
+ } else {
612
+ wordsEl . style . marginLeft = `0` ;
613
+ for ( const afterNewline of afterNewlineEls ) {
614
+ afterNewline . style . marginLeft = `0` ;
615
+ }
616
+ }
597
617
}
598
618
}
599
619
You can’t perform that action at this time.
0 commit comments