diff options
| -rw-r--r-- | www/js/EventCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MonitorCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/app.js | 8 |
5 files changed, 9 insertions, 7 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index d842c4ed..5ca4bead 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -117,7 +117,7 @@ angular.module('zmApp.controllers') $ionicPlatform.registerBackButtonAction(function (e) { e.preventDefault(); - if ($scope.modal.isShown()) + if ($scope.modal !=undefined && $scope.modal.isShown()) { // switch off awake, as liveview is finished ZMDataModel.zmDebug("Modal is open, closing it"); diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 35921adc..45fb501c 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -734,7 +734,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro if (ld.useNphZmsForEvents) { $timeout(function () { - if ($scope.modal.isShown()) { + if ($scope.modal != undefined && $scope.modal.isShown()) { ZMDataModel.zmLog(">>>Starting checkAllEvents interval..."); //eventQueryHandle = $timeout (checkEvent(), zm.eventPlaybackQuery); diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 42683717..97110760 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -31,7 +31,7 @@ angular.module('zmApp.controllers') $ionicPlatform.registerBackButtonAction(function (e) { e.preventDefault(); - if ($scope.modal.isShown()) { + if ($scope.modal != undefined && $scope.modal.isShown()) { // switch off awake, as liveview is finished ZMDataModel.zmDebug("Modal is open, closing it"); ZMDataModel.setAwake(false); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 2fa976b3..d463ed8d 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -32,7 +32,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $ionicPlatform.registerBackButtonAction(function (e) { e.preventDefault(); - if ($scope.modal && $scope.modal.isShown()) + if ($scope.modal !=undefined && $scope.modal.isShown()) { // switch off awake, as liveview is finished ZMDataModel.zmDebug("Modal is open, closing it"); diff --git a/www/js/app.js b/www/js/app.js index 7ffc2933..4c76bee4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -950,7 +950,7 @@ angular.module('zmApp', [ // only for android $rootScope.exitApp = function () { ZMDataModel.zmLog("user exited app"); - ZMDataModel.zmLog("user exited app"); + ionic.Platform.exitApp(); }; @@ -982,15 +982,17 @@ angular.module('zmApp', [ // This code takes care of trapping the Android back button // and takes it to the menu. + console.log (">>>>>>>>>>>>>>>>>>BACK BUTTON REGISTERED"); $ionicPlatform.registerBackButtonAction(function (e) { e.preventDefault(); + console.log ("******** back called with isOpenLeft: " + $ionicSideMenuDelegate.isOpenLeft()); if (!$ionicSideMenuDelegate.isOpenLeft()) { $ionicSideMenuDelegate.toggleLeft(); - //console.log("Status of SIDE MENU IS : " + $ionicSideMenuDelegate.isOpen()); + console.log("Status of SIDE MENU IS : " + $ionicSideMenuDelegate.isOpen()); } else { navigator.app.exitApp(); } - }, 1000); + }, 501); // this works reliably on both Android and iOS. The "onorientation" seems to reverse w/h in Android. Go figure. |
