* Gets the client position from the event * @param {MouseEvent & TouchEvent} e * @returns {MouseEvent}
(e)
| 410 | * @returns {MouseEvent} |
| 411 | */ |
| 412 | function getClientPos(e) { |
| 413 | const { touches, changedTouches } = e; |
| 414 | |
| 415 | let { clientX = 0, clientY = 0 } = e; |
| 416 | |
| 417 | if (touches?.length) { |
| 418 | const [touch] = touches; |
| 419 | clientX = touch.clientX; |
| 420 | clientY = touch.clientY; |
| 421 | } else if (changedTouches?.length) { |
| 422 | const [touch] = changedTouches; |
| 423 | clientX = touch.clientX; |
| 424 | clientY = touch.clientY; |
| 425 | } |
| 426 | |
| 427 | return { clientX, clientY }; |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Update the position of the file list |
no outgoing calls
no test coverage detected