From 5a9038cfeffdda6d02ff6626f178c52b8c9d83e2 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 18 Nov 2025 20:01:55 +0100 Subject: [PATCH] chore: move code --- frontend/src/ts/event-handlers/global.ts | 10 ++++++++++ frontend/src/ts/ui.ts | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/ts/event-handlers/global.ts b/frontend/src/ts/event-handlers/global.ts index 7e3434bf6..8941c6254 100644 --- a/frontend/src/ts/event-handlers/global.ts +++ b/frontend/src/ts/event-handlers/global.ts @@ -29,6 +29,16 @@ document.addEventListener("keydown", async (e) => { } }); +//stop space scrolling +window.addEventListener("keydown", function (e) { + if ( + e.code === "Space" && + (e.target === document.body || (e.target as HTMLElement)?.id === "result") + ) { + e.preventDefault(); + } +}); + window.onerror = function (message, url, line, column, error): void { if (Misc.isDevEnvironment()) { Notifications.add(error?.message ?? "Undefined message", -1, { diff --git a/frontend/src/ts/ui.ts b/frontend/src/ts/ui.ts index af93a4c30..414d7f0be 100644 --- a/frontend/src/ts/ui.ts +++ b/frontend/src/ts/ui.ts @@ -65,16 +65,6 @@ if (isDevEnvironment()) { ); } -//stop space scrolling -window.addEventListener("keydown", function (e) { - if ( - e.code === "Space" && - (e.target === document.body || (e.target as HTMLElement)?.id === "result") - ) { - e.preventDefault(); - } -}); - window.addEventListener("beforeunload", (event) => { // Cancel the event as stated by the standard. if (