Skip to content

Commit

Permalink
fix(nav): transition name
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Mar 27, 2018
1 parent 98403fa commit 011a374
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
8 changes: 4 additions & 4 deletions core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}
}

Expand Down
6 changes: 0 additions & 6 deletions core/src/components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
7 changes: 0 additions & 7 deletions core/src/components/nav/view-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion core/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export class Tabs implements NavOutlet {
}
await this.setActive(selectedTab);
await this.notifyRouter();
await this.tabSwitch();
this.tabSwitch();

return true;
}

Expand Down

0 comments on commit 011a374

Please sign in to comment.