diff options
-rw-r--r-- | src/app.js | 9 | ||||
-rw-r--r-- | src/webview/recipe.js | 13 |
2 files changed, 22 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()); |
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index a14c01b68..847a720ff 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -193,6 +193,19 @@ class RecipeController { | |||
193 | textColor: '#212121', | 193 | textColor: '#212121', |
194 | }); | 194 | }); |
195 | }); | 195 | }); |
196 | |||
197 | // Add ability to go forward or back with mouse buttons (inside the recipe) | ||
198 | window.addEventListener('mouseup', e => { | ||
199 | if (e.button === 3) { | ||
200 | e.preventDefault() | ||
201 | e.stopPropagation() | ||
202 | window.history.back() | ||
203 | } else if (e.button === 4) { | ||
204 | e.preventDefault() | ||
205 | e.stopPropagation() | ||
206 | window.history.forward() | ||
207 | } | ||
208 | }); | ||
196 | } | 209 | } |
197 | 210 | ||
198 | loadRecipeModule(event, config, recipe) { | 211 | loadRecipeModule(event, config, recipe) { |