diff options
| -rw-r--r-- | www/js/LogCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/ModalCtrl.js | 1 | ||||
| -rw-r--r-- | www/js/MonitorCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/StateCtrl.js | 13 | ||||
| -rw-r--r-- | www/js/app.js | 3 |
5 files changed, 16 insertions, 7 deletions
diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js index fb1fc6a6..27be0cce 100644 --- a/www/js/LogCtrl.js +++ b/www/js/LogCtrl.js @@ -15,12 +15,12 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo $scope.deleteLogs = function () { - var confirmPopup = $ionicPopup.confirm({ + $rootScope.zmPopup = $ionicPopup.confirm({ title: 'Please Confirm', template: 'Are you sure you want to delete logs?', }); - confirmPopup.then(function (res) { + $rootScope.zmPopup.then(function (res) { if (res) { $fileLogger.deleteLogfile().then(function () { console.log('Logfile deleted'); diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 834eeecc..c1ce47a9 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -358,7 +358,6 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco // Saves a snapshot of the monitor image to phone storage //----------------------------------------------------------------------- - $scope.saveImageToPhone = function (mid) { $ionicLoading.show({ template: "saving snapshot...", diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index b93f35ae..7f8679eb 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -74,7 +74,7 @@ angular.module('zmApp.controllers') myenabled: checked }; - var getConfig = $ionicPopup.show({ + $rootScope.zmPopup = $ionicPopup.show({ scope: $scope, template: '<ion-toggle ng-model="monfunc.myenabled" ng-checked="{{monfunc.myenabled}}" toggle-class="toggle-calm">Enabled</ion-toggle><ion-radio-fix ng-repeat="item in monFunctions" ng-value="item.value" ng-model="monfunc.myfunc"> {{item.text}} </ion-radio-fix>', diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js index bfffa49c..592ae72e 100644 --- a/www/js/StateCtrl.js +++ b/www/js/StateCtrl.js @@ -19,6 +19,10 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' $scope.dangerButtonColor = ["button-positive", "button-assertive"]; $scope.customState = ""; $scope.allStateNames = []; + + $rootScope.zmPopup = ""; + + var loginData = ZMDataModel.getLogin(); @@ -92,6 +96,9 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' ); } + + + //--------------------------------------------------------- // Allows the user to select a custom run state @@ -102,7 +109,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' }; console.log(JSON.stringify($scope.allStateNames)); ZMDataModel.zmLog("List of custom states: " + JSON.stringify($scope.allStateNames)); - var getConfig = $ionicPopup.show({ + $rootScope.zmPopup = $ionicPopup.show({ scope: $scope, template: '<ion-radio-fix ng-repeat="item in allStateNames" ng-value="item" ng-model="myopt.selectedState"> {{item}} </ion-radio-fix>', @@ -129,7 +136,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // It seems invoking a popup within a popup handler // causes issues. Doing this outside due to that reason - getConfig.then(function (res) { + $rootScope.zmPopup.then(function (res) { console.log("GOT : " + JSON.stringify(res)); if (res == "OK") { if ($scope.myopt.selectedState != "") @@ -298,7 +305,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' } - $ionicPopup.show({ + $rootScope.zmPopup = $ionicPopup.show({ title: 'Please Confirm', template: promptstring, buttons: [ diff --git a/www/js/app.js b/www/js/app.js index 131b23f9..7a624d5b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -626,6 +626,9 @@ angular.module('zmApp', [ ZMDataModel.zmLog("App is going into background"); zmAutoLogin.stop(); + if ($rootScope.zmPopup) + $rootScope.zmPopup.close(); + //$ionicPopup.close(); }, false); |
