From a3f68a5027ae93464bfaf506032c8fd166bc4494 Mon Sep 17 00:00:00 2001 From: DarkIntaqt <61588850+DarkIntaqt@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:21:40 +0200 Subject: [PATCH] more buttons for navigation --- src/module/Challenge.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/module/Challenge.js b/src/module/Challenge.js index db5a33b..95d593d 100644 --- a/src/module/Challenge.js +++ b/src/module/Challenge.js @@ -273,13 +273,14 @@ class Challenge extends Component { changeFilter(e) { - var isRightMB; + var isRightMB = false; + var isMB2 = false; e.preventDefault(); if ("which" in e) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera isRightMB = e.which === 3; - else if ("button" in e) // IE, Opera - isRightMB = e.button === 2; + isMB2 = e.which === 2; + let filter = "world"; @@ -291,7 +292,7 @@ class Challenge extends Component { filter = e.target.id; - if (isRightMB) { + if (isRightMB || e.ctrlKey || e.altKey) { filter = ""; for (let i = 0; i < this.regions.length; i++) { @@ -305,9 +306,7 @@ class Challenge extends Component { } - else if (e.shiftKey) { - - console.log("SHIFT") + else if (e.shiftKey || isMB2) { const tempFilter = this.state.filter.split(";") if (tempFilter.includes(filter)) {