(opts: TransitionOptions, transitioningInactiveHeader: HTMLElement | null)
| 55 | }; |
| 56 | |
| 57 | const beforeTransition = (opts: TransitionOptions, transitioningInactiveHeader: HTMLElement | null) => { |
| 58 | const enteringEl = opts.enteringEl; |
| 59 | const leavingEl = opts.leavingEl; |
| 60 | |
| 61 | focusController.saveViewFocus(leavingEl); |
| 62 | |
| 63 | setZIndex(enteringEl, leavingEl, opts.direction); |
| 64 | // Prevent flickering of the header by adding a class. |
| 65 | setHeaderTransitionClass(transitioningInactiveHeader, true); |
| 66 | |
| 67 | if (opts.showGoBack) { |
| 68 | enteringEl.classList.add('can-go-back'); |
| 69 | } else { |
| 70 | enteringEl.classList.remove('can-go-back'); |
| 71 | } |
| 72 | setPageHidden(enteringEl, false); |
| 73 | |
| 74 | /** |
| 75 | * When transitioning, the page should not |
| 76 | * respond to click events. This resolves small |
| 77 | * issues like users double tapping the ion-back-button. |
| 78 | * These pointer events are removed in `afterTransition`. |
| 79 | */ |
| 80 | enteringEl.style.setProperty('pointer-events', 'none'); |
| 81 | |
| 82 | if (leavingEl) { |
| 83 | setPageHidden(leavingEl, false); |
| 84 | leavingEl.style.setProperty('pointer-events', 'none'); |
| 85 | } |
| 86 | }; |
| 87 | |
| 88 | const runTransition = async (opts: TransitionOptions): Promise<TransitionResult> => { |
| 89 | const animationBuilder = await getAnimationBuilder(opts); |
no test coverage detected