fix(menu): fix swipe to go back and left menu conflict

Closes #5575
This commit is contained in:
Adam Bradley
2016-05-19 23:11:36 -05:00
parent b742e1f0da
commit f18a62485d
7 changed files with 48 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import {App, IonicApp, MenuController, Page, NavController, Alert} from '../../../../../src';
import {ViewChild} from '@angular/core';
import {App, IonicApp, MenuController, Page, NavController, Alert, Nav} from '../../../../../src';
@Page({
@@ -16,6 +17,10 @@ class Page1 {
});
this.nav.present(alert);
}
goToPage2() {
this.nav.push(Page2);
}
}
@@ -40,6 +45,7 @@ class E2EApp {
rootPage;
changeDetectionCount: number = 0;
pages: Array<{title: string, component: any}>;
@ViewChild(Nav) nav: Nav;
constructor(private app: IonicApp, private menu: MenuController) {
this.rootPage = Page1;
@@ -54,8 +60,7 @@ class E2EApp {
openPage(page) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
let nav = this.app.getComponent('nav');
nav.setRoot(page.component).then(() => {
this.nav.setRoot(page.component).then(() => {
// wait for the root page to be completely loaded
// then close the menu
this.menu.close();

View File

@@ -138,6 +138,6 @@
</ion-menu>
<ion-nav id="nav" [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
<ion-nav id="nav" [root]="rootPage" #content></ion-nav>
<div [hidden]="isChangeDetecting()"></div>

View File

@@ -51,6 +51,10 @@
<button (click)="presentAlert()">Open alert</button>
</p>
<p>
<button (click)="goToPage2()">Go to Page 2</button>
</p>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
</ion-content>