()
| 552 | * Run all "after" animation hooks. |
| 553 | */ |
| 554 | const afterAnimation = () => { |
| 555 | clearCSSAnimationsTimeout(); |
| 556 | |
| 557 | // Runs all after read callbacks |
| 558 | _afterAddReadFunctions.forEach((callback) => callback()); |
| 559 | |
| 560 | // Runs all after write callbacks |
| 561 | _afterAddWriteFunctions.forEach((callback) => callback()); |
| 562 | |
| 563 | // Updates styles and classes before animation ends |
| 564 | const currentStep = willComplete ? 1 : 0; |
| 565 | const addClasses = afterAddClasses; |
| 566 | const removeClasses = afterRemoveClasses; |
| 567 | const styles = afterStylesValue; |
| 568 | |
| 569 | elements.forEach((el) => { |
| 570 | const elementClassList = el.classList; |
| 571 | |
| 572 | addClasses.forEach((c) => elementClassList.add(c)); |
| 573 | removeClasses.forEach((c) => elementClassList.remove(c)); |
| 574 | |
| 575 | for (const property in styles) { |
| 576 | // eslint-disable-next-line no-prototype-builtins |
| 577 | if (styles.hasOwnProperty(property)) { |
| 578 | setStyleProperty(el, property, styles[property]); |
| 579 | } |
| 580 | } |
| 581 | }); |
| 582 | |
| 583 | /** |
| 584 | * Clean up any value coercion before |
| 585 | * the user callbacks fire otherwise |
| 586 | * they may get stale values. For example, |
| 587 | * if someone calls progressStart(0) the |
| 588 | * animation may still be reversed. |
| 589 | */ |
| 590 | forceDurationValue = undefined; |
| 591 | forceDirectionValue = undefined; |
| 592 | forceDelayValue = undefined; |
| 593 | |
| 594 | onFinishCallbacks.forEach((onFinishCallback) => { |
| 595 | return onFinishCallback.c(currentStep, ani); |
| 596 | }); |
| 597 | |
| 598 | onFinishOneTimeCallbacks.forEach((onFinishCallback) => { |
| 599 | return onFinishCallback.c(currentStep, ani); |
| 600 | }); |
| 601 | |
| 602 | onFinishOneTimeCallbacks.length = 0; |
| 603 | |
| 604 | shouldCalculateNumAnimations = true; |
| 605 | if (willComplete) { |
| 606 | finished = true; |
| 607 | } |
| 608 | willComplete = true; |
| 609 | }; |
| 610 | |
| 611 | const animationFinish = () => { |
no test coverage detected