stop current animation first in animateElement()

This commit is contained in:
tophf 2017-08-21 17:48:30 +03:00
parent 83dcc488dd
commit 291c3a3ec5

View File

@ -119,7 +119,12 @@ function animateElement(
}
resolve();
});
if (element.classList.contains(className)) {
element.classList.remove(className);
setTimeout(() => element.classList.add(className));
} else {
element.classList.add(className);
}
});
}