diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-01 19:09:25 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-01 19:09:25 -0400 |
| commit | 3a22b40f6381bb066a7039a491c88d771d016e3f (patch) | |
| tree | 6012783ccc90152a4ff613bd0d0d383558934999 /www/js/StateCtrl.js | |
| parent | 07f76ec873bbd27afd7f6e5db81883afb14b09c3 (diff) | |
maek sure popups go away on resume
Diffstat (limited to 'www/js/StateCtrl.js')
| -rw-r--r-- | www/js/StateCtrl.js | 13 |
1 files changed, 10 insertions, 3 deletions
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: [ |
