MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / pointerDown

Function pointerDown

core/src/utils/gesture/index.ts:57–88  ·  view source on GitHub ↗
(ev: UIEvent)

Source from the content-addressed store, hash-verified

55 });
56
57 const pointerDown = (ev: UIEvent): boolean => {
58 const timeStamp = now(ev);
59 if (hasStartedPan || !hasFiredStart) {
60 return false;
61 }
62
63 updateDetail(ev, detail);
64 detail.startX = detail.currentX;
65 detail.startY = detail.currentY;
66 detail.startTime = detail.currentTime = timeStamp;
67 detail.velocityX = detail.velocityY = detail.deltaX = detail.deltaY = 0;
68 detail.event = ev;
69
70 // Check if gesture can start
71 if (canStart && canStart(detail) === false) {
72 return false;
73 }
74 // Release fallback
75 gesture.release();
76
77 // Start gesture
78 if (!gesture.start()) {
79 return false;
80 }
81
82 hasStartedPan = true;
83 if (threshold === 0) {
84 return tryToCapturePan();
85 }
86 pan.start(detail.startX, detail.startY);
87 return true;
88 };
89
90 const pointerMove = (ev: UIEvent) => {
91 // fast path, if gesture is currently captured

Callers 2

handleTouchStartFunction · 0.70
handleMouseDownFunction · 0.70

Calls 6

updateDetailFunction · 0.85
tryToCapturePanFunction · 0.85
nowFunction · 0.70
canStartFunction · 0.70
startMethod · 0.65
releaseMethod · 0.45

Tested by

no test coverage detected