From 6cbb438a0cb76dfa6e6363b31673a42b7abdb574 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Thu, 9 Jun 2022 14:47:25 +0100 Subject: Feature: Add ability to navigate recipe with mouse buttons (#223) --- src/webview/recipe.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/webview/recipe.js') 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 { textColor: '#212121', }); }); + + // Add ability to go forward or back with mouse buttons (inside the recipe) + window.addEventListener('mouseup', e => { + if (e.button === 3) { + e.preventDefault() + e.stopPropagation() + window.history.back() + } else if (e.button === 4) { + e.preventDefault() + e.stopPropagation() + window.history.forward() + } + }); } loadRecipeModule(event, config, recipe) { -- cgit v1.2.3-54-g00ecf