Sha256: a615f12e813770a02b9dfa754669b9e7c0eeba35f2e5fad867cc586576c85ed0
Contents?: true
Size: 1.24 KB
Versions: 44
Compression:
Stored size: 1.24 KB
Contents
var Events = require('./events'); module.exports = { _testSupportedProps: function(props) { var i, undefined, el = document.createElement('div'); for (i in props) { if (props.hasOwnProperty(i) && el.style[i] !== undefined) { return props[i]; } } }, //Returns the correct event name to use transitionEndEventName: function() { return this._testSupportedProps({ 'transition':'transitionend', 'OTransition':'otransitionend', 'MozTransition':'transitionend', 'WebkitTransition':'webkitTransitionEnd' }); }, animationEndEventName: function() { return this._testSupportedProps({ 'animation': 'animationend', '-o-animation': 'oAnimationEnd', '-moz-animation': 'animationend', '-webkit-animation': 'webkitAnimationEnd' }); }, onTransitionEnd: function (el, callback) { var transitionEnd = this.transitionEndEventName(); Events.once(el, transitionEnd, function() { return callback(); }); }, onAnimationEnd: function (el, callback) { var animationEnd = this.animationEndEventName(); Events.once(el, animationEnd, function() { return callback(); }); } };
Version data entries
44 entries across 44 versions & 1 rubygems