@@ -116,16 +116,11 @@ ConfigEvent.subscribe((eventKey, eventValue, nosave) => {
116116 if ( eventKey === "burstHeatmap" ) void applyBurstHeatmap ( ) ;
117117} ) ;
118118
119- export let resultVisible = false ;
120119export let activeWordTop = 0 ;
121120export let lineTransition = false ;
122121export let currentTestLine = 0 ;
123122export let resultCalculating = false ;
124123
125- export function setResultVisible ( val : boolean ) : void {
126- resultVisible = val ;
127- }
128-
129124export function setActiveWordTop ( val : number ) : void {
130125 activeWordTop = val ;
131126}
@@ -331,7 +326,7 @@ async function joinOverlappingHints(
331326async function updateHintsPosition ( ) : Promise < void > {
332327 if (
333328 ActivePage . get ( ) !== "test" ||
334- resultVisible ||
329+ TestState . resultVisible ||
335330 Config . indicateTypos !== "below"
336331 )
337332 return ;
@@ -585,7 +580,7 @@ export async function centerActiveLine(): Promise<void> {
585580}
586581
587582export function updateWordsWrapperHeight ( force = false ) : void {
588- if ( ActivePage . get ( ) !== "test" || resultVisible ) return ;
583+ if ( ActivePage . get ( ) !== "test" || TestState . resultVisible ) return ;
589584 if ( ! force && Config . mode !== "custom" ) return ;
590585 const wrapperEl = document . getElementById ( "wordsWrapper" ) as HTMLElement ;
591586 const outOfFocusEl = document . querySelector (
@@ -904,7 +899,7 @@ export async function scrollTape(
904899 noRemove = false ,
905900 afterCompleteFn ?: ( ) => void
906901) : Promise < void > {
907- if ( ActivePage . get ( ) !== "test" || resultVisible ) return ;
902+ if ( ActivePage . get ( ) !== "test" || TestState . resultVisible ) return ;
908903
909904 await centeringActiveLine ;
910905
@@ -1394,7 +1389,7 @@ async function loadWordsHistory(): Promise<boolean> {
13941389}
13951390
13961391export function toggleResultWords ( noAnimation = false ) : void {
1397- if ( resultVisible ) {
1392+ if ( TestState . resultVisible ) {
13981393 ResultWordHighlight . updateToggleWordsHistoryTime ( ) ;
13991394 if ( $ ( "#resultWordsHistory" ) . stop ( true , true ) . hasClass ( "hidden" ) ) {
14001395 //show
@@ -1699,7 +1694,7 @@ $(".pageTest #result #wpmChart").on("mouseenter", () => {
16991694} ) ;
17001695
17011696$ ( ".pageTest #resultWordsHistory" ) . on ( "mouseenter" , ".words .word" , ( e ) => {
1702- if ( resultVisible ) {
1697+ if ( TestState . resultVisible ) {
17031698 const input = $ ( e . currentTarget ) . attr ( "input" ) ;
17041699 const burst = parseInt ( $ ( e . currentTarget ) . attr ( "burst" ) as string ) ;
17051700 if ( input !== undefined ) {
@@ -1729,14 +1724,14 @@ addEventListener("resize", () => {
17291724$ ( "#wordsInput" ) . on ( "focus" , ( e ) => {
17301725 const wordsFocused = e . target === document . activeElement ;
17311726 if ( ! wordsFocused ) return ;
1732- if ( ! resultVisible && Config . showOutOfFocusWarning ) {
1727+ if ( ! TestState . resultVisible && Config . showOutOfFocusWarning ) {
17331728 OutOfFocus . hide ( ) ;
17341729 }
17351730 Caret . show ( true ) ;
17361731} ) ;
17371732
17381733$ ( "#wordsInput" ) . on ( "focusout" , ( ) => {
1739- if ( ! resultVisible && Config . showOutOfFocusWarning ) {
1734+ if ( ! TestState . resultVisible && Config . showOutOfFocusWarning ) {
17401735 OutOfFocus . show ( ) ;
17411736 }
17421737 Caret . hide ( ) ;
0 commit comments