Skip to content

Commit

Permalink
more buttons for navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIntaqt committed Jun 26, 2024
1 parent 361ef34 commit a3f68a5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/module/Challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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++) {
Expand All @@ -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)) {
Expand Down

0 comments on commit a3f68a5

Please sign in to comment.