fix(menu): do not disable app during menu open/close

Closes #175
This commit is contained in:
Adam Bradley
2015-09-23 20:02:44 -05:00
parent 51fa25996c
commit 3f7b3aadef
3 changed files with 5 additions and 11 deletions

View File

@@ -74,6 +74,6 @@ class MyApp {
menu.close();
let nav = this.app.getComponent('myNav');
nav.setViews([page.page]);
nav.setRoot(page.page);
}
}

View File

@@ -2,9 +2,9 @@
<ion-toolbar><ion-title>Plugins</ion-title></ion-toolbar>
<ion-content>
<ion-list>
<ion-item *ng-for="#p of plugins" (click)="openPage(menu, p)">
<span>{{p.title}}</span>
</ion-item>
<button ion-item *ng-for="#p of plugins" (click)="openPage(menu, p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>

View File

@@ -136,14 +136,12 @@ export class Menu extends Ion {
setProgess(value) {
// user actively dragging the menu
this._disable();
this.app.setEnabled(false, 4000);
this._type.setProgess(value);
}
setProgressEnd(shouldComplete) {
// user has finished dragging the menu
this._disable();
this.app.setEnabled(false);
this._type.setProgressEnd(shouldComplete).then(isOpen => {
this._after(isOpen);
});
@@ -156,16 +154,12 @@ export class Menu extends Ion {
this.getBackdropElement().classList.add('show-backdrop');
this._disable();
this.app.setEnabled(false);
}
_after(isOpen) {
// keep opening/closing the menu disabled for a touch more yet
this._disable();
// but the app itself can be used again
this.app.setEnabled(true);
this.isOpen = isOpen;
this._cntEle.classList[isOpen ? 'add' : 'remove']('menu-content-open');
@@ -183,7 +177,7 @@ export class Menu extends Ion {
_disable() {
// used to prevent unwanted opening/closing after swiping open/close
// or swiping open the menu while pressing down on the menu-toggle
this._disableTime = Date.now() + 300;
this._disableTime = Date.now() + 20;
}
_isDisabled() {