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 => {
|
||||
function handleAnimationEnd(evt)
|
||||
{
|
||||
if (evt.animationName === animationName)
|
||||
elem.onanimationend = (event) => {
|
||||
if(event.animationName === animation_name)
|
||||
{
|
||||
elem.onanimationend = null;
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
|
||||
elem.onanimationend = handleAnimationEnd;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue