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

Function getClientPos

src/handlers/editorFileTab.js:412–428  ·  view source on GitHub ↗

* Gets the client position from the event * @param {MouseEvent & TouchEvent} e * @returns {MouseEvent}

(e)

Source from the content-addressed store, hash-verified

410 * @returns {MouseEvent}
411 */
412function 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

Callers 3

startDragFunction · 0.85
onDragFunction · 0.85
releaseDragFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected