ember-sortable
Version:
Sortable UI primitives for Ember.
36 lines (33 loc) • 653 B
JavaScript
/**
Gets the y offset for a given event.
Work for touch and mouse events.
@method getY
@return {Number}
@private
*/
function getY(event) {
const touches = event.changedTouches;
const touch = touches && touches[0];
if (touch) {
return touch.screenY;
} else {
return event.clientY;
}
}
/**
Gets the x offset for a given event.
@method getX
@return {Number}
@private
*/
function getX(event) {
const touches = event.changedTouches;
const touch = touches && touches[0];
if (touch) {
return touch.screenX;
} else {
return event.clientX;
}
}
export { getX, getY };
//# sourceMappingURL=coordinate.js.map