* Event handler for touchend event * @param {TouchEvent} e
(e)
| 260 | * @param {TouchEvent} e |
| 261 | */ |
| 262 | function touchend(e) { |
| 263 | const { $row1 } = quickTools; |
| 264 | const $el = document.elementFromPoint( |
| 265 | e.changedTouches[0].clientX, |
| 266 | e.changedTouches[0].clientY, |
| 267 | ); |
| 268 | |
| 269 | if (touchMoved && $row) { |
| 270 | $row.style.scrollBehavior = "smooth"; |
| 271 | let scroll = 0; |
| 272 | if (movedX < 0 && movedX < -MOVE_X_THRESHOLD) { |
| 273 | scroll = (slide - 1) * $row.clientWidth; |
| 274 | } else if (movedX > 0 && movedX > MOVE_X_THRESHOLD) { |
| 275 | scroll = (slide + 1) * $row.clientWidth; |
| 276 | } else { |
| 277 | scroll = slide * $row.clientWidth; |
| 278 | } |
| 279 | |
| 280 | if ($row === $row1) { |
| 281 | localStorage.quickToolRow1ScrollLeft = scroll; |
| 282 | } else { |
| 283 | localStorage.quickToolRow2ScrollLeft = scroll; |
| 284 | } |
| 285 | |
| 286 | $row.scrollLeft = scroll; |
| 287 | touchcancel(e); |
| 288 | |
| 289 | if ($el === $touchstart && performance.now() - startTime < 100) { |
| 290 | click($el); |
| 291 | } |
| 292 | return; |
| 293 | } |
| 294 | |
| 295 | if ($touchstart !== $el || contextmenu) { |
| 296 | touchcancel(e); |
| 297 | return; |
| 298 | } |
| 299 | |
| 300 | touchcancel(e); |
| 301 | click($el); |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * |
nothing calls this directly
no test coverage detected