diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 9 | ||||
| -rw-r--r-- | www/js/app.js | 65 |
2 files changed, 44 insertions, 30 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 3633d384..ec2686b4 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -75,6 +75,7 @@ angular.module('zmApp.controllers') 'packeryPositions':'', 'packerySizes':'', 'timelineModalGraphType':'all', + 'resumeDelay':300, }; @@ -451,6 +452,14 @@ angular.module('zmApp.controllers') loginData.timelineModalGraphType = 'all'; } + if (typeof loginData.resumeDelay == 'undefined') + { + zmDebug ("resumeDelay does not exist. Setting to 0"); + loginData.resumeDelay = "0"; + + } + + if (typeof loginData.montageHistoryQuality == 'undefined') { diff --git a/www/js/app.js b/www/js/app.js index 603c4867..6f2bf72b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1248,38 +1248,42 @@ angular.module('zmApp', [ // from foreground to background and back document.addEventListener("resume", function () { ZMDataModel.zmLog("App is resuming from background"); - var ld = ZMDataModel.getLogin(); + var forceDelay = ZMDataModel.getLogin().resumeDelay; + ZMDataModel.zmLog (">>> Resume delayed for " + forceDelay + " ms, to wait for network stack..."); + $timeout (function () { + var ld = ZMDataModel.getLogin(); - ZMDataModel.setBackground(false); - // don't animate - $ionicHistory.nextViewOptions({ - disableAnimate: true, - disableBack: true - }); - // remember the last state so we can - // go back there after auth - if ($ionicHistory.currentView) { - $rootScope.lastState = $ionicHistory.currentView().stateName; - $rootScope.lastStateParam = - $ionicHistory.currentView().stateParams; - ZMDataModel.zmDebug("Last State recorded:" + - JSON.stringify($ionicHistory.currentView())); - - if ($rootScope.lastState == "zm-portal-login") { - ZMDataModel.zmDebug("Last state was portal-login, so forcing montage"); - $rootScope.lastState = "montage"; + ZMDataModel.setBackground(false); + // don't animate + $ionicHistory.nextViewOptions({ + disableAnimate: true, + disableBack: true + }); + + // remember the last state so we can + // go back there after auth + if ($ionicHistory.currentView) { + $rootScope.lastState = $ionicHistory.currentView().stateName; + $rootScope.lastStateParam = + $ionicHistory.currentView().stateParams; + ZMDataModel.zmDebug("Last State recorded:" + + JSON.stringify($ionicHistory.currentView())); + + if ($rootScope.lastState == "zm-portal-login") { + ZMDataModel.zmDebug("Last state was portal-login, so forcing montage"); + $rootScope.lastState = "montage"; + } + + ZMDataModel.zmDebug ("going to portal login"); + $state.go("zm-portal-login"); + } else { + $rootScope.lastState = ""; + $rootScope.lastStateParam = ""; + ZMDataModel.zmDebug ("reset lastState to null"); } - - ZMDataModel.zmDebug ("going to portal login"); - $state.go("zm-portal-login"); - } else { - $rootScope.lastState = ""; - $rootScope.lastStateParam = ""; - ZMDataModel.zmDebug ("reset lastState to null"); - } - + }, forceDelay); //$ionicSideMenuDelegate.toggleLeft(false); @@ -1357,7 +1361,7 @@ angular.module('zmApp', [ //------------------------------------------------------------------ // My route map connecting menu options to their respective templates and controllers -.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide) { +.config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $provide,$compileProvider) { // This is an exception interceptor so it can show up in app logs @@ -1383,7 +1387,8 @@ angular.module('zmApp', [ //$httpProvider.defaults.withCredentials = true; $httpProvider.interceptors.push('timeoutHttpIntercept'); $ionicConfigProvider.navBar.alignTitle('center'); - //$ionicConfigProvider.scrolling.jsScrolling(false); + $ionicConfigProvider.scrolling.jsScrolling(false); + $compileProvider.debugInfoEnabled(false); $stateProvider .state('app', { |
