chore: move code

This commit is contained in:
Miodec 2025-11-18 20:01:55 +01:00
parent 3454da18e0
commit 5a9038cfef
2 changed files with 10 additions and 10 deletions

View file

@ -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, {

View file

@ -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 (