diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-06-09 14:47:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-09 14:47:25 +0100 |
commit | 6cbb438a0cb76dfa6e6363b31673a42b7abdb574 (patch) | |
tree | 82d0a23ce670c2a5b88e249e84878ca999a1d3a3 /src/webview | |
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/webview')
-rw-r--r-- | src/webview/recipe.js | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |