aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2023-03-07 21:02:26 +0100
committerMiodec <[email protected]>2023-03-07 21:02:26 +0100
commit6a587ede8d6f9bbca9c3d811de71c9c3c43fd94a (patch)
tree293c15e39db5ba4a0931b884b29a52e8972e7a9d
parent88bf436baa4cb2bf7c61203c84140648ade4fe0d (diff)
downloadmonkeytype-6a587ede8d6f9bbca9c3d811de71c9c3c43fd94a.tar.gz
monkeytype-6a587ede8d6f9bbca9c3d811de71c9c3c43fd94a.zip
reverted the sleep and checking tape mode instead
-rw-r--r--frontend/src/ts/test/test-ui.ts43
1 files changed, 20 insertions, 23 deletions
diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts
index cfe39e7bd..6dcc8c31c 100644
--- a/frontend/src/ts/test/test-ui.ts
+++ b/frontend/src/ts/test/test-ui.ts
@@ -197,33 +197,30 @@ export function showWords(): void {
const posUpdateLangList = ["japanese", "chinese", "korean"];
function updateWordsInputPosition(force = false): void {
- Misc.sleep(10).then(() => {
- //for some reason without sleep the css bugs out????
- const shouldUpdate = posUpdateLangList.some((l) =>
- Config.language.startsWith(l)
- );
+ const shouldUpdate = posUpdateLangList.some((l) =>
+ Config.language.startsWith(l)
+ );
- if (!force && !shouldUpdate) return;
+ if (!force && !shouldUpdate) return;
- const el = document.querySelector("#wordsInput") as HTMLElement;
- const activeWord = document.querySelector(
- "#words .active"
- ) as HTMLElement | null;
+ const el = document.querySelector("#wordsInput") as HTMLElement;
+ const activeWord = document.querySelector(
+ "#words .active"
+ ) as HTMLElement | null;
- if (!activeWord) {
- el.style.top = "0px";
- el.style.left = "0px";
- return;
- }
+ if (!activeWord) {
+ el.style.top = "0px";
+ el.style.left = "0px";
+ return;
+ }
- if (!shouldUpdate) {
- el.style.top = activeWord.offsetHeight * 2 + "px";
- el.style.left = "0px";
- } else {
- el.style.top = activeWord.offsetTop + "px";
- el.style.left = activeWord.offsetLeft + "px";
- }
- });
+ if (!shouldUpdate && Config.tapeMode == "off") {
+ el.style.top = activeWord.offsetHeight * 2 + "px";
+ el.style.left = "0px";
+ } else {
+ el.style.top = activeWord.offsetTop + "px";
+ el.style.left = activeWord.offsetLeft + "px";
+ }
}
function updateWordsHeight(force = false): void {