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

Function playTransition

core/src/utils/transition/index.ts:187–208  ·  view source on GitHub ↗
(trans: Animation, opts: TransitionOptions)

Source from the content-addressed store, hash-verified

185};
186
187const playTransition = (trans: Animation, opts: TransitionOptions): Promise<boolean> => {
188 const progressCallback = opts.progressCallback;
189
190 const promise = new Promise<boolean>((resolve) => {
191 trans.onFinish((currentStep: any) => resolve(currentStep === 1));
192 });
193
194 // cool, let's do this, start the transition
195 if (progressCallback) {
196 // this is a swipe to go back, just get the transition progress ready
197 // kick off the swipe animation start
198 trans.progressStart(true);
199 progressCallback(trans);
200 } else {
201 // only the top level transition should actually start "play"
202 // kick it off and let it play through
203 // ******** DOM WRITE ****************
204 trans.play();
205 }
206 // create a callback for when the animation is done
207 return promise;
208};
209
210const fireWillEvents = (enteringEl: HTMLElement | undefined, leavingEl: HTMLElement | undefined) => {
211 lifecycle(leavingEl, LIFECYCLE_WILL_LEAVE);

Callers 1

animationFunction · 0.85

Calls 4

resolveFunction · 0.85
onFinishMethod · 0.80
progressStartMethod · 0.80
playMethod · 0.80

Tested by

no test coverage detected