Merge branch 'patch-1' of github.com:Gibolt/animate.css into Gibolt-patch-1

This commit is contained in:
Elton Mesquita 2020-09-17 18:55:46 +01:00
commit fcd44f4d44
1 changed files with 2 additions and 4 deletions

View File

@ -37,14 +37,12 @@ const animateCSS = (element, animation, prefix = 'animate__') =>
node.classList.add(`${prefix}animated`, animationName);
// When the animation ends, we clean the classes and resolve the Promise
function handleAnimationEnd() {
handleAnimationEnd = () => {
node.classList.remove(`${prefix}animated`, animationName);
node.removeEventListener('animationend', handleAnimationEnd);
resolve('Animation ended');
}
node.addEventListener('animationend', handleAnimationEnd);
node.addEventListener('animationend', handleAnimationEnd, {once : true});
});
```