Merge branch 'patch-1' of github.com:Gibolt/animate.css into Gibolt-patch-1
This commit is contained in:
commit
fcd44f4d44
|
@ -37,14 +37,12 @@ const animateCSS = (element, animation, prefix = 'animate__') =>
|
||||||
node.classList.add(`${prefix}animated`, animationName);
|
node.classList.add(`${prefix}animated`, animationName);
|
||||||
|
|
||||||
// When the animation ends, we clean the classes and resolve the Promise
|
// When the animation ends, we clean the classes and resolve the Promise
|
||||||
function handleAnimationEnd() {
|
handleAnimationEnd = () => {
|
||||||
node.classList.remove(`${prefix}animated`, animationName);
|
node.classList.remove(`${prefix}animated`, animationName);
|
||||||
node.removeEventListener('animationend', handleAnimationEnd);
|
|
||||||
|
|
||||||
resolve('Animation ended');
|
resolve('Animation ended');
|
||||||
}
|
}
|
||||||
|
|
||||||
node.addEventListener('animationend', handleAnimationEnd);
|
node.addEventListener('animationend', handleAnimationEnd, {once : true});
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue