MCPcopy Create free account
hub / github.com/ampproject/amphtml / onTouchMove_

Method onTouchMove_

src/pull-to-refresh.js:107–123  ·  view source on GitHub ↗

* @param {!Event} event * @private

(event)

Source from the content-addressed store, hash-verified

105 * @private
106 */
107 onTouchMove_(event) {
108 if (!this.tracking_) {
109 return;
110 }
111
112 const dy = event.touches[0].clientY - this.startPos_;
113
114 // Immediately cancel the P2R if dragging down.
115 if (dy > 0) {
116 event.preventDefault();
117 }
118
119 // Stop tracking if there was any motion at all.
120 if (dy != 0) {
121 this.stopTracking_();
122 }
123 }
124
125 /**
126 * @param {!Event} unusedEvent

Callers

nothing calls this directly

Calls 1

stopTracking_Method · 0.95

Tested by

no test coverage detected