MCPcopy Index your code
hub / github.com/plotly/plotly.js / attachWheelEventHandler

Function attachWheelEventHandler

src/plots/cartesian/dragbox.js:1335–1353  ·  view source on GitHub ↗
(element, handler)

Source from the content-addressed store, hash-verified

1333
1334// still seems to be some confusion about onwheel vs onmousewheel...
1335function attachWheelEventHandler(element, handler) {
1336 if(!supportsPassive) {
1337 if(element.onwheel !== undefined) element.onwheel = handler;
1338 else if(element.onmousewheel !== undefined) element.onmousewheel = handler;
1339 else if(!element.isAddedWheelEvent) {
1340 element.isAddedWheelEvent = true;
1341 element.addEventListener('wheel', handler, {passive: false});
1342 }
1343 } else {
1344 var wheelEventName = element.onwheel !== undefined ? 'wheel' : 'mousewheel';
1345
1346 if(element._onwheel) {
1347 element.removeEventListener(wheelEventName, element._onwheel);
1348 }
1349 element._onwheel = handler;
1350
1351 element.addEventListener(wheelEventName, handler, {passive: false});
1352 }
1353}
1354
1355function hashValues(hash) {
1356 var out = [];

Callers 1

makeDragBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…