Skip to content

Commit

Permalink
Fix for wheel gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
MRSallee committed May 24, 2021
1 parent b450d18 commit a9ebb50
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions graphtool.js
Original file line number Diff line number Diff line change
Expand Up @@ -1981,18 +1981,6 @@ function setFocusedPanel() {
panelsContainer.setAttribute("data-focused-panel","secondary");
});

secondaryPanel.addEventListener("wheel", function(e) {
let wheelDelta = e.deltaY;

if (wheelDelta < -5) {
panelsContainer.setAttribute("data-focused-panel","primary");
}

if (wheelDelta > 5) {
panelsContainer.setAttribute("data-focused-panel","secondary");
}
});

graphBox.addEventListener("click", function() {
let previousState = panelsContainer.getAttribute("data-focused-panel");

Expand Down Expand Up @@ -2038,6 +2026,18 @@ function setFocusedPanel() {
touchNow = 0;
touchDelta = 0;
});

target.addEventListener("wheel", function(e) {
let wheelDelta = e.deltaY;

if (wheelDelta < -5) {
panelsContainer.setAttribute("data-focused-panel","primary");
}

if (wheelDelta > 5) {
panelsContainer.setAttribute("data-focused-panel","secondary");
}
});
});
}
setFocusedPanel();
Expand Down

0 comments on commit a9ebb50

Please sign in to comment.