Better waitForAnimation end function (?). Maybe it was better before....
This commit is contained in:
parent
eedcb0a8c9
commit
313787cf55
|
|
@ -1,16 +1,13 @@
|
||||||
function waitForAnimationEnd(elem, animationName)
|
function waitForAnimationEnd(elem, animation_name)
|
||||||
{
|
{
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
function handleAnimationEnd(evt)
|
elem.onanimationend = (event) => {
|
||||||
{
|
if(event.animationName === animation_name)
|
||||||
if (evt.animationName === animationName)
|
|
||||||
{
|
{
|
||||||
elem.onanimationend = null;
|
elem.onanimationend = null;
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
elem.onanimationend = handleAnimationEnd;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue