Base edit view
This commit is contained in:
23
js/components/mixins/animate.js
Normal file
23
js/components/mixins/animate.js
Normal file
@ -0,0 +1,23 @@
|
||||
var Events = {
|
||||
ANIMATION_END: 'webkitAnimationEnd'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
play: function(component, animation) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
var el = component.getDOMNode();
|
||||
|
||||
el.addEventListener(Events.ANIMATION_END, onAnimEnd, false);
|
||||
el.style.webkitAnimation = animation;
|
||||
|
||||
function onAnimEnd(evt) {
|
||||
el.removeEventListener(Events.ANIMATION_END, onAnimEnd);
|
||||
return resolve(el);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
};
|
Reference in New Issue
Block a user