Skip to content

Commit 5a9038c

Browse files
committed
chore: move code
1 parent 3454da1 commit 5a9038c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

frontend/src/ts/event-handlers/global.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ document.addEventListener("keydown", async (e) => {
2929
}
3030
});
3131

32+
//stop space scrolling
33+
window.addEventListener("keydown", function (e) {
34+
if (
35+
e.code === "Space" &&
36+
(e.target === document.body || (e.target as HTMLElement)?.id === "result")
37+
) {
38+
e.preventDefault();
39+
}
40+
});
41+
3242
window.onerror = function (message, url, line, column, error): void {
3343
if (Misc.isDevEnvironment()) {
3444
Notifications.add(error?.message ?? "Undefined message", -1, {

frontend/src/ts/ui.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ if (isDevEnvironment()) {
6565
);
6666
}
6767

68-
//stop space scrolling
69-
window.addEventListener("keydown", function (e) {
70-
if (
71-
e.code === "Space" &&
72-
(e.target === document.body || (e.target as HTMLElement)?.id === "result")
73-
) {
74-
e.preventDefault();
75-
}
76-
});
77-
7868
window.addEventListener("beforeunload", (event) => {
7969
// Cancel the event as stated by the standard.
8070
if (

0 commit comments

Comments
 (0)