refactor(navCtrl): move async parts of transition into their own fn

This commit is contained in:
Adam Bradley
2015-12-01 19:59:21 -06:00
parent 8889e0a71e
commit 85e773b56b
5 changed files with 269 additions and 154 deletions

View File

@@ -53,9 +53,13 @@ export class IonicApp {
* it will automatically enable the app again. It's basically a fallback incase
* something goes wrong during a transition and the app wasn't re-enabled correctly.
*/
setEnabled(isEnabled, fallback=700) {
this._disTime = (isEnabled ? 0 : Date.now() + fallback);
this._clickBlock.show(!isEnabled, fallback + 100);
setEnabled(isEnabled, duration=700) {
this._disTime = (isEnabled ? 0 : Date.now() + duration);
if (duration > 32 || isEnabled) {
// only do a click block if the duration is longer than XXms
this._clickBlock.show(!isEnabled, duration + 64);
}
}
/**