fix(nav): transition name

This commit is contained in:
Manu Mtz.-Almeida
2018-03-27 22:57:58 +02:00
parent 98403fa883
commit 011a374f6b
4 changed files with 6 additions and 18 deletions

View File

@ -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<Animation> {
private async startAnimation(shouldOpen: boolean, animated: boolean): Promise<void> {
const ani = this.animation.reverse(!shouldOpen);
if (animated) {
return ani.playAsync();
await ani.playAsync();
} else {
ani.playSync();
return Promise.resolve(ani);
}
}

View File

@ -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<NavResult> {

View File

@ -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
*/

View File

@ -105,7 +105,8 @@ export class Tabs implements NavOutlet {
}
await this.setActive(selectedTab);
await this.notifyRouter();
await this.tabSwitch();
this.tabSwitch();
return true;
}