UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

25 lines (24 loc) 841 B
/** * DevExtreme (esm/__internal/events/core/m_hook_touch_props.js) * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ const touchPropsToHook = ["pageX", "pageY", "screenX", "screenY", "clientX", "clientY"]; const touchPropHook = function(name, event) { if (event[name] && !event.touches || !event.touches) { return event[name] } const touches = event.touches.length ? event.touches : event.changedTouches; if (!touches.length) { return } return touches[0][name] }; export default function(callback) { touchPropsToHook.forEach((name => { callback(name, (event => touchPropHook(name, event))) }), this) }