File tree Expand file tree Collapse file tree 4 files changed +159
-112
lines changed
Expand file tree Collapse file tree 4 files changed +159
-112
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as TestState from "../test/test-state";
44import { subscribe } from "../observables/config-event" ;
55import { Caret } from "../utils/caret" ;
66import * as CompositionState from "../states/composition" ;
7+ import { qsr } from "../utils/dom" ;
78
89export function stopAnimation ( ) : void {
910 caret . stopBlinking ( ) ;
@@ -40,10 +41,7 @@ export function updatePosition(noAnim = false): void {
4041 } ) ;
4142}
4243
43- export const caret = new Caret (
44- document . getElementById ( "caret" ) as HTMLElement ,
45- Config . caretStyle ,
46- ) ;
44+ export const caret = new Caret ( qsr ( "#caret" ) , Config . caretStyle ) ;
4745
4846subscribe ( ( eventKey ) => {
4947 if ( eventKey === "caretStyle" ) {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import * as TestState from "./test-state";
66import * as ConfigEvent from "../observables/config-event" ;
77import { getActiveFunboxes } from "./funbox/list" ;
88import { Caret } from "../utils/caret" ;
9+ import { qsr } from "../utils/dom" ;
910
1011type Settings = {
1112 wpm : number ;
@@ -22,10 +23,7 @@ let startTimestamp = 0;
2223
2324export let settings : Settings | null = null ;
2425
25- export const caret = new Caret (
26- document . getElementById ( "paceCaret" ) as HTMLElement ,
27- Config . paceCaretStyle ,
28- ) ;
26+ export const caret = new Caret ( qsr ( "#paceCaret" ) , Config . paceCaretStyle ) ;
2927
3028let lastTestWpm = 0 ;
3129
You can’t perform that action at this time.
0 commit comments