diff --git a/ionic/components/app/app.ts b/ionic/components/app/app.ts index 87a8f6c12f..b5cfe8dfcf 100644 --- a/ionic/components/app/app.ts +++ b/ionic/components/app/app.ts @@ -41,7 +41,7 @@ export class IonicApp { */ constructor() { this.overlays = []; - this._enableTime = 0; + this._disableTime = 0; // Our component registry map this.components = {}; @@ -89,7 +89,7 @@ export class IonicApp { * something goes wrong during a transition and the app wasn't re-enabled correctly. */ setEnabled(isEnabled, fallback=700) { - this._enableTime = (isEnabled ? 0 : Date.now() + fallback); + this._disableTime = (isEnabled ? 0 : Date.now() + fallback); ClickBlock(!isEnabled, fallback + 100); } @@ -98,7 +98,7 @@ export class IonicApp { * @return {bool} */ isEnabled() { - return (this._enableTime < Date.now()); + return (this._disableTime < Date.now()); } /** diff --git a/ionic/components/menu/menu.ts b/ionic/components/menu/menu.ts index e15fb636fa..ff6ffeb869 100644 --- a/ionic/components/menu/menu.ts +++ b/ionic/components/menu/menu.ts @@ -148,7 +148,6 @@ export class Menu extends Ion { this.getBackdropElement().classList.add('show-backdrop'); this._disable(); - this.app.setEnabled(false); } _after(isOpen) { @@ -165,18 +164,16 @@ export class Menu extends Ion { this.getNativeElement().classList.remove('show-menu'); this.getBackdropElement().classList.remove('show-backdrop'); } - - this.app.setEnabled(true); } _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(); + this._disableTime = Date.now() + 300; } _isDisabled() { - return this._disableTime + 300 > Date.now(); + return this._disableTime > Date.now(); } /** diff --git a/ionic/components/view/view-controller.ts b/ionic/components/view/view-controller.ts index 3fc5f4bfdf..97ebd70b18 100644 --- a/ionic/components/view/view-controller.ts +++ b/ionic/components/view/view-controller.ts @@ -45,6 +45,7 @@ export class ViewController extends Ion { this.id = ++ctrlIds; this._ids = -1; this.zIndexes = -1; + this._disableTime = 0; // build a new injector for child ViewItems to use this.bindings = Injector.resolve([ @@ -531,7 +532,7 @@ export class ViewController extends Ion { // used to prevent unwanted transitions after JUST completing one // prevents the user from crazy clicking everything and possible flickers // gives the app some time to cool off, slow down, and think about life - this._enableTime = Date.now() + 100; + this._disableTime = Date.now() + 40; // IonicApp global setEnabled to prevent other things from starting up this.app.setEnabled(isEnabled, fallback); @@ -539,7 +540,7 @@ export class ViewController extends Ion { _isEnabled() { // used to prevent unwanted transitions after JUST completing one - if (this._enableTime > Date.now()) { + if (this._disableTime > Date.now()) { return false; } // IonicApp global isEnabled, maybe something else has the app disabled