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);
}
}