diff options
author | 2022-06-09 14:47:25 +0100 | |
---|---|---|
committer | 2022-06-09 14:47:25 +0100 | |
commit | 6cbb438a0cb76dfa6e6363b31673a42b7abdb574 (patch) | |
tree | 82d0a23ce670c2a5b88e249e84878ca999a1d3a3 /src/app.js | |
parent | 6.0.0-nightly.55 [skip ci] (diff) | |
download | ferdium-app-6cbb438a0cb76dfa6e6363b31673a42b7abdb574.tar.gz ferdium-app-6cbb438a0cb76dfa6e6363b31673a42b7abdb574.tar.zst ferdium-app-6cbb438a0cb76dfa6e6363b31673a42b7abdb574.zip |
Feature: Add ability to navigate recipe with mouse buttons (#223)
Diffstat (limited to 'src/app.js')
-rw-r--r-- | src/app.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js index 5d6ac9b8d..c56cda241 100644 --- a/src/app.js +++ b/src/app.js | |||
@@ -49,6 +49,15 @@ window.addEventListener('load', () => { | |||
49 | window['ferdium'].render(); | 49 | window['ferdium'].render(); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | // Prevent back and forward mouse events for the app itself (not inside the recipe) | ||
53 | // TODO: send this request to the recipe.js | ||
54 | window.addEventListener('mouseup', e => { | ||
55 | if (e.button === 3 || e.button === 4) { | ||
56 | e.preventDefault() | ||
57 | e.stopPropagation() | ||
58 | } | ||
59 | }); | ||
60 | |||
52 | // Prevent drag and drop into window from redirecting | 61 | // Prevent drag and drop into window from redirecting |
53 | window.addEventListener('dragover', event => event.preventDefault()); | 62 | window.addEventListener('dragover', event => event.preventDefault()); |
54 | window.addEventListener('drop', event => event.preventDefault()); | 63 | window.addEventListener('drop', event => event.preventDefault()); |