MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / beforeAnimation

Function beforeAnimation

core/src/utils/animation/animation.ts:524–549  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

522 * Run all "before" animation hooks.
523 */
524 const beforeAnimation = () => {
525 // Runs all before read callbacks
526 _beforeAddReadFunctions.forEach((callback) => callback());
527
528 // Runs all before write callbacks
529 _beforeAddWriteFunctions.forEach((callback) => callback());
530
531 // Updates styles and classes before animation runs
532 const addClasses = beforeAddClasses;
533 const removeClasses = beforeRemoveClasses;
534 const styles = beforeStylesValue;
535
536 elements.forEach((el) => {
537 const elementClassList = el.classList;
538
539 addClasses.forEach((c) => elementClassList.add(c));
540 removeClasses.forEach((c) => elementClassList.remove(c));
541
542 for (const property in styles) {
543 // eslint-disable-next-line no-prototype-builtins
544 if (styles.hasOwnProperty(property)) {
545 setStyleProperty(el, property, styles[property]);
546 }
547 }
548 });
549 };
550
551 /**
552 * Run all "after" animation hooks.

Callers 1

initializeAnimationFunction · 0.85

Calls 3

setStylePropertyFunction · 0.90
callbackFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected