Commit 9142ce81 authored by Andray's avatar Andray

fix linter and do not require reload page if option was changed

parent 79514e5b
...@@ -839,12 +839,13 @@ onUiLoaded(async() => { ...@@ -839,12 +839,13 @@ onUiLoaded(async() => {
document.addEventListener("keydown", handleMoveKeyDown); document.addEventListener("keydown", handleMoveKeyDown);
document.addEventListener("keyup", handleMoveKeyUp); document.addEventListener("keyup", handleMoveKeyUp);
// Prevent firefox to open toolbar on pressing alt // Prevent firefox to open toolbar on pressing alt
if (hotkeysConfig.canvas_hotkey_zoom === "Alt") {
let isAltPressed = false; let isAltPressed = false;
function handleAltKeyDown(e) { function handleAltKeyDown(e) {
if (!activeElement) return; if (!activeElement) return;
if (hotkeysConfig.canvas_hotkey_zoom !== "Alt") return;
if (e.code === "AltLeft" || e.code === "AltRight") { if (e.code === "AltLeft" || e.code === "AltRight") {
isAltPressed = true; isAltPressed = true;
} else { } else {
...@@ -853,6 +854,7 @@ onUiLoaded(async() => { ...@@ -853,6 +854,7 @@ onUiLoaded(async() => {
} }
function handleAltKeyUp(e) { function handleAltKeyUp(e) {
if (hotkeysConfig.canvas_hotkey_zoom !== "Alt") return;
if (isAltPressed) { if (isAltPressed) {
e.preventDefault(); e.preventDefault();
} }
...@@ -861,7 +863,6 @@ onUiLoaded(async() => { ...@@ -861,7 +863,6 @@ onUiLoaded(async() => {
document.addEventListener("keydown", handleAltKeyDown); document.addEventListener("keydown", handleAltKeyDown);
document.addEventListener("keyup", handleAltKeyUp); document.addEventListener("keyup", handleAltKeyUp);
}
// Detect zoom level and update the pan speed. // Detect zoom level and update the pan speed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment