(trans: Animation, opts: TransitionOptions)
| 185 | }; |
| 186 | |
| 187 | const 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 | |
| 210 | const fireWillEvents = (enteringEl: HTMLElement | undefined, leavingEl: HTMLElement | undefined) => { |
| 211 | lifecycle(leavingEl, LIFECYCLE_WILL_LEAVE); |
no test coverage detected