UNPKG

sweetalert2

Version:

A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert

23 lines (19 loc) 560 B
import { isNodeEnv } from '../isNodeEnv' export const animationEndEvent = (() => { // Prevent run in Node env if (isNodeEnv()) { return false } const testEl = document.createElement('div') const transEndEventNames = { 'WebkitAnimation': 'webkitAnimationEnd', 'OAnimation': 'oAnimationEnd oanimationend', 'animation': 'animationend' } for (const i in transEndEventNames) { if (transEndEventNames.hasOwnProperty(i) && typeof testEl.style[i] !== 'undefined') { return transEndEventNames[i] } } return false })()