UNPKG

@vnmfify/core

Version:

```shell npm i @vnmfify/core -S ```

35 lines (31 loc) 674 B
import { inBrowser } from "../base"; export function stopPropagation(event) { event.stopPropagation(); } export function preventDefault(event, isStopPropagation) { if (inBrowser) { if (typeof event.cancelable !== "boolean" || event.cancelable) { event.preventDefault(); } } else { event.preventDefault(); } if (isStopPropagation) { stopPropagation(event); } } export function getClientCoordinates(event) { var { clientX, clientY, touches } = event; if (clientX && clientY) { return { clientX, clientY }; } return touches[0]; } //# sourceMappingURL=event.js.map