MCPcopy
hub / github.com/bevacqua/dragula / touchy

Function touchy

dragula.js:498–522  ·  view source on GitHub ↗
(el, op, type, fn)

Source from the content-addressed store, hash-verified

496}
497
498function touchy (el, op, type, fn) {
499 var touch = {
500 mouseup: 'touchend',
501 mousedown: 'touchstart',
502 mousemove: 'touchmove'
503 };
504 var pointers = {
505 mouseup: 'pointerup',
506 mousedown: 'pointerdown',
507 mousemove: 'pointermove'
508 };
509 var microsoft = {
510 mouseup: 'MSPointerUp',
511 mousedown: 'MSPointerDown',
512 mousemove: 'MSPointerMove'
513 };
514 if (global.navigator.pointerEnabled) {
515 crossvent[op](el, pointers[type], fn);
516 } else if (global.navigator.msPointerEnabled) {
517 crossvent[op](el, microsoft[type], fn);
518 } else {
519 crossvent[op](el, touch[type], fn);
520 crossvent[op](el, type, fn);
521 }
522}
523
524function whichMouseButton (e) {
525 if (e.touches !== void 0) { return e.touches.length; }

Callers 4

eventsFunction · 0.85
eventualMovementsFunction · 0.85
renderMirrorImageFunction · 0.85
removeMirrorImageFunction · 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…