From 3a22b40f6381bb066a7039a491c88d771d016e3f Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Thu, 1 Oct 2015 19:09:25 -0400 Subject: maek sure popups go away on resume --- www/js/StateCtrl.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'www/js/StateCtrl.js') 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: ' {{item}} ', @@ -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: [ -- cgit v1.2.3