diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/LoginCtrl.js | 1 | ||||
| -rw-r--r-- | www/js/MenuController.js | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 23d442bf..923e1baa 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -460,6 +460,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r NVRDataModel.debug ("Inside save Items"); $rootScope.alarmCount = 0; + $rootScope.isAlarm = false; NVRDataModel.setFirstUse(false); NVRDataModel.setCurrentServerVersion(''); diff --git a/www/js/MenuController.js b/www/js/MenuController.js index acc5f266..2970243d 100644 --- a/www/js/MenuController.js +++ b/www/js/MenuController.js @@ -48,10 +48,8 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io function switchToServer(s) { $rootScope.alarmCount = 0; - if ($ionicSideMenuDelegate.isOpen()) { - $ionicSideMenuDelegate.toggleLeft(); - - } + $rootScope.isAlarm = false; + // First lets kill current stuf NVRDataModel.debug ("** Resetting existing server"); @@ -227,7 +225,10 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io buttons: [{ text: $translate.instant('kButtonCancel'), onTap: function (e) { - //return "CANCEL"; + if ($ionicSideMenuDelegate.isOpen()) { + $ionicSideMenuDelegate.toggleLeft(); + + } } }, @@ -235,7 +236,12 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io text: $translate.instant('kButtonOk'), onTap: function (e) { NVRDataModel.log("Server selected:" + $scope.newServer.val); - switchToServer($scope.newServer.val); + if ($ionicSideMenuDelegate.isOpen()) { + $ionicSideMenuDelegate.toggleLeft(); + + } + if (NVRDataModel.getLogin().serverName != $scope.newServer.val) + switchToServer($scope.newServer.val); //$rootScope.$broadcast('server-changed'); |
