mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-08 16:34:45 +08:00
remove zen word removal, its handled somewhere else
add comment
This commit is contained in:
parent
2c53b205f5
commit
b8bf7c93bd
1 changed files with 4 additions and 7 deletions
|
|
@ -134,18 +134,15 @@ export function updateActiveElement(
|
|||
let previousActiveWordTop: number | null = null;
|
||||
if (initial === undefined) {
|
||||
const previousActiveWord = wordsEl.querySelector<HTMLElement>(".active");
|
||||
// in zen mode, because of the animation frame, previousActiveWord will be removed at this point, so check for null
|
||||
if (previousActiveWord !== null) {
|
||||
previousActiveWordTop = previousActiveWord.offsetTop;
|
||||
if (direction === "forward") {
|
||||
previousActiveWord.classList.add("typed");
|
||||
previousActiveWord.classList.remove("active");
|
||||
} else if (direction === "back") {
|
||||
if (Config.mode === "zen") {
|
||||
previousActiveWord.remove();
|
||||
} else {
|
||||
previousActiveWord.classList.remove("active");
|
||||
}
|
||||
//
|
||||
}
|
||||
previousActiveWord.classList.remove("active");
|
||||
previousActiveWordTop = previousActiveWord.offsetTop;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue