mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
chore: move code
This commit is contained in:
parent
3454da18e0
commit
5a9038cfef
2 changed files with 10 additions and 10 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue