Version React iso-fonctionnelle

This commit is contained in:
2015-08-27 22:52:30 +02:00
parent 1d24cf6779
commit 7fc7f9d10e
12 changed files with 223 additions and 354 deletions

23
js/mixins/animate.js Normal file
View 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);
}
});
}
};