50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
"use strict";
|
|
|
|
exports.__esModule = true;
|
|
exports.events = void 0;
|
|
|
|
var _query = require("../query");
|
|
|
|
var _cancelAnimationFramePolyfill2 = _interopRequireDefault(require("./cancelAnimationFramePolyfill"));
|
|
|
|
exports.cancelAnimationFramePolyfill = _cancelAnimationFramePolyfill2["default"];
|
|
|
|
var _nativeRequestAnimationFrame2 = _interopRequireDefault(require("./nativeRequestAnimationFrame"));
|
|
|
|
exports.nativeRequestAnimationFrame = _nativeRequestAnimationFrame2["default"];
|
|
|
|
var _requestAnimationFramePolyfill2 = _interopRequireDefault(require("./requestAnimationFramePolyfill"));
|
|
|
|
exports.requestAnimationFramePolyfill = _requestAnimationFramePolyfill2["default"];
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
var vendorMap = {
|
|
animation: 'animationend',
|
|
OAnimation: 'oAnimationEnd',
|
|
MozAnimation: 'animationend',
|
|
WebkitAnimation: 'webkitAnimationEnd'
|
|
};
|
|
|
|
function getAnimationEvent() {
|
|
if (!_query.canUseDOM) {
|
|
return;
|
|
}
|
|
|
|
var tempAnimationEnd;
|
|
var style = document.createElement('div').style;
|
|
|
|
for (tempAnimationEnd in vendorMap) {
|
|
if (style[tempAnimationEnd] !== undefined) {
|
|
return vendorMap[tempAnimationEnd];
|
|
}
|
|
}
|
|
}
|
|
|
|
var events = function events() {
|
|
return {
|
|
end: getAnimationEvent()
|
|
};
|
|
};
|
|
|
|
exports.events = events; |