MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / touchStart

Function touchStart

src/components/scrollbar/index.js:115–129  ·  view source on GitHub ↗

* * @param {TouchEvent|MouseEvent} e

(e)

Source from the content-addressed store, hash-verified

113 * @param {TouchEvent|MouseEvent} e
114 */
115 function touchStart(e) {
116 e.preventDefault();
117 touchStarted = true;
118 if (!rect) resize();
119 const touch = e.type === "touchstart" ? e.touches[0] : e;
120 touchStartValue.x = touch.clientX;
121 touchStartValue.y = touch.clientY;
122 $scrollbar.classList.add("active");
123 document.addEventListener("touchmove", touchMove, config);
124 document.addEventListener("mousemove", touchMove, config);
125 document.addEventListener("touchend", touchEnd, config);
126 document.addEventListener("mouseup", touchEnd, config);
127 document.addEventListener("touchcancel", touchEnd, config);
128 clearTimeout(scrollbarTimeoutHide);
129 }
130
131 /**
132 *

Callers

nothing calls this directly

Calls 3

resizeFunction · 0.85
addMethod · 0.80
preventDefaultMethod · 0.45

Tested by

no test coverage detected