Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
anvaka committed Dec 15, 2023
1 parent 362ef05 commit 0d4d50a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
20 changes: 3 additions & 17 deletions dist/vivagraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -3881,37 +3881,23 @@ function dragndrop(element) {
}

e.returnValue = false;
var delta,
var delta = -e.deltaY,
mousePos = getMousePos(e),
elementOffset = findElementPosition(element),
relMousePos = {
x: mousePos[0] - elementOffset[0],
y: mousePos[1] - elementOffset[1]
};

if (e.wheelDelta) {
delta = e.wheelDelta / 360; // Chrome/Safari
} else {
delta = e.detail / -9; // Mozilla
}

scroll(e, delta, relMousePos);
},

updateScrollEvents = function (scrollCallback) {
if (!scroll && scrollCallback) {
// client is interested in scrolling. Start listening to events:
if (browserInfo.browser === 'webkit') {
element.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari
} else {
element.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others
}
element.addEventListener('wheel', handleMouseWheel, false);
} else if (scroll && !scrollCallback) {
if (browserInfo.browser === 'webkit') {
element.removeEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari
} else {
element.removeEventListener('DOMMouseScroll', handleMouseWheel, false); // Others
}
element.removeEventListener('wheel', handleMouseWheel, false);
}

scroll = scrollCallback;
Expand Down
Loading

0 comments on commit 0d4d50a

Please sign in to comment.