From 6d9b0957782a043d281468c37e0271c8f3dfedec Mon Sep 17 00:00:00 2001 From: filifa Date: Thu, 11 Dec 2025 23:49:35 -0500 Subject: [PATCH] put all initializations together --- main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 2dcdd25..e39241f 100644 --- a/main.js +++ b/main.js @@ -51,10 +51,6 @@ function evaluate() { }, 500); } -const expr = document.querySelector("#expr"); -let selectionStart = 0; -let selectionEnd = 0; - function setupExprInput() { selectionStart = expr.selectionStart; selectionEnd = expr.selectionEnd; @@ -121,6 +117,10 @@ function switchInputs(enabled) { document.querySelector("#modulus").disabled = !enabled; } +const expr = document.querySelector("#expr"); +let selectionStart = 0; +let selectionEnd = 0; + let timeoutId = null; const worker = new Worker("./workers/compute.js"); worker.addEventListener("message", (message) => {