mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 08:27:31 +09:00
13 lines
422 B
JavaScript
13 lines
422 B
JavaScript
|
|
function waitForIterationChange(animation) {
|
||
|
|
var initialIteration = animation.effect.getComputedTiming().currentIteration;
|
||
|
|
return new Promise(resolve => {
|
||
|
|
window.requestAnimationFrame(handleFrame = () => {
|
||
|
|
if (animation.effect.getComputedTiming().currentIteration !=
|
||
|
|
initialIteration) {
|
||
|
|
resolve();
|
||
|
|
} else {
|
||
|
|
window.requestAnimationFrame(handleFrame);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|