mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(nav): transition name
This commit is contained in:
@ -218,7 +218,8 @@ export class Menu {
|
|||||||
this.beforeAnimation();
|
this.beforeAnimation();
|
||||||
await this.loadAnimation();
|
await this.loadAnimation();
|
||||||
await this.startAnimation(shouldOpen, animated);
|
await this.startAnimation(shouldOpen, animated);
|
||||||
await this.afterAnimation(shouldOpen);
|
this.afterAnimation(shouldOpen);
|
||||||
|
|
||||||
return shouldOpen;
|
return shouldOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,13 +246,12 @@ export class Menu {
|
|||||||
this.animation = await this.menuCtrl.createAnimation(this.type, this);
|
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);
|
const ani = this.animation.reverse(!shouldOpen);
|
||||||
if (animated) {
|
if (animated) {
|
||||||
return ani.playAsync();
|
await ani.playAsync();
|
||||||
} else {
|
} else {
|
||||||
ani.playSync();
|
ani.playSync();
|
||||||
return Promise.resolve(ani);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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> {
|
private async _transition(enteringView: ViewController, leavingView: ViewController, ti: TransitionInstruction): Promise<NavResult> {
|
||||||
|
@ -63,13 +63,6 @@ export class ViewController {
|
|||||||
return this._nav;
|
return this._nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
getTransitionName(_direction: string): string {
|
|
||||||
return this._nav && this._nav.config && this._nav.config.get('pageTransition') || 'md';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +105,8 @@ export class Tabs implements NavOutlet {
|
|||||||
}
|
}
|
||||||
await this.setActive(selectedTab);
|
await this.setActive(selectedTab);
|
||||||
await this.notifyRouter();
|
await this.notifyRouter();
|
||||||
await this.tabSwitch();
|
this.tabSwitch();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user