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) => {