From 011a374f6b5bd0b563c4072794cac603907168a8 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 27 Mar 2018 22:57:58 +0200 Subject: [PATCH] fix(nav): transition name --- core/src/components/menu/menu.tsx | 8 ++++---- core/src/components/nav/nav.tsx | 6 ------ core/src/components/nav/view-controller.ts | 7 ------- core/src/components/tabs/tabs.tsx | 3 ++- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index e46936897b..8950739a13 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -218,7 +218,8 @@ export class Menu { this.beforeAnimation(); await this.loadAnimation(); await this.startAnimation(shouldOpen, animated); - await this.afterAnimation(shouldOpen); + this.afterAnimation(shouldOpen); + return shouldOpen; } @@ -245,13 +246,12 @@ export class Menu { this.animation = await this.menuCtrl.createAnimation(this.type, this); } - private startAnimation(shouldOpen: boolean, animated: boolean): Promise { + private async startAnimation(shouldOpen: boolean, animated: boolean): Promise { const ani = this.animation.reverse(!shouldOpen); if (animated) { - return ani.playAsync(); + await ani.playAsync(); } else { ani.playSync(); - return Promise.resolve(ani); } } diff --git a/core/src/components/nav/nav.tsx b/core/src/components/nav/nav.tsx index 6d1edfd406..7022d77ea9 100644 --- a/core/src/components/nav/nav.tsx +++ b/core/src/components/nav/nav.tsx @@ -581,12 +581,6 @@ export class NavControllerBase implements NavOutlet { } } - // set which animation it should use if it wasn't set yet - if (ti.requiresTransition && !opts.animation) { - opts.animation = isPresent(ti.removeStart) - ? (leavingView || enteringView).getTransitionName(opts.direction) - : (enteringView || leavingView).getTransitionName(opts.direction); - } } private async _transition(enteringView: ViewController, leavingView: ViewController, ti: TransitionInstruction): Promise { diff --git a/core/src/components/nav/view-controller.ts b/core/src/components/nav/view-controller.ts index d703b6cc51..ef0e6b2c08 100644 --- a/core/src/components/nav/view-controller.ts +++ b/core/src/components/nav/view-controller.ts @@ -63,13 +63,6 @@ export class ViewController { return this._nav; } - /** - * @hidden - */ - getTransitionName(_direction: string): string { - return this._nav && this._nav.config && this._nav.config.get('pageTransition') || 'md'; - } - /** * @hidden */ diff --git a/core/src/components/tabs/tabs.tsx b/core/src/components/tabs/tabs.tsx index 2b6dd19a0f..6dc1a10ce1 100644 --- a/core/src/components/tabs/tabs.tsx +++ b/core/src/components/tabs/tabs.tsx @@ -105,7 +105,8 @@ export class Tabs implements NavOutlet { } await this.setActive(selectedTab); await this.notifyRouter(); - await this.tabSwitch(); + this.tabSwitch(); + return true; }