(e)
| 165 | } |
| 166 | |
| 167 | function touchstart(e) { |
| 168 | reset(); |
| 169 | |
| 170 | const $el = e.target; |
| 171 | if ($el instanceof HTMLInputElement) { |
| 172 | return; |
| 173 | } |
| 174 | if ($el.disabled) { |
| 175 | e.preventDefault(); |
| 176 | e.stopPropagation(); |
| 177 | return; |
| 178 | } |
| 179 | |
| 180 | startTime = performance.now(); |
| 181 | $touchstart = $el; |
| 182 | e.preventDefault(); |
| 183 | e.stopPropagation(); |
| 184 | |
| 185 | if ($el.dataset.repeat === "true") { |
| 186 | contextmenuTimeout = setTimeout(() => { |
| 187 | if (touchMoved) return; |
| 188 | contextmenu = true; |
| 189 | oncontextmenu(e); |
| 190 | }, CONTEXT_MENU_TIMEOUT); |
| 191 | } |
| 192 | |
| 193 | if ($el.classList.contains("active")) { |
| 194 | active = true; |
| 195 | } else { |
| 196 | $el.classList.add("active"); |
| 197 | } |
| 198 | |
| 199 | document.addEventListener("touchmove", touchmove); |
| 200 | document.addEventListener("keyup", touchcancel); |
| 201 | document.addEventListener("touchend", touchend); |
| 202 | document.addEventListener("touchcancel", touchcancel); |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Event handler for touchmove event |
nothing calls this directly
no test coverage detected