diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-08 20:29:20 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-08 20:29:20 -0400 |
| commit | e5cc1c5826f65b5d40892cd92714cc9f070198a9 (patch) | |
| tree | 8384bbb90d81808e0dca96bee889dd38eb158b43 /www/js/PortalLoginCtrl.js | |
| parent | a9273df91eced721b23f311e37b8d820f5951ada (diff) | |
broadcast handler cleanups and others
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index 4161c5b9..9971de86 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -7,12 +7,21 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic { var processPush = false; + var broadcastHandles = []; $scope.$on ('$ionicView.beforeEnter', function() { //processPush = false; // NVRDataModel.debug ("BeforeEnter in Portal: setting ProcessPush to false"); }); + $scope.$on ('$ionicView.beforeLeave', function() { + NVRDataModel.debug ("Deregistering broadcast handles"); + for (var i=0; i < broadcastHandles.length; i++) { + broadcastHandles[i](); + } + broadcastHandles = []; + }); + $scope.$on('$ionicView.enter', function() { @@ -276,13 +285,14 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic } - $rootScope.$on("process-push", function () { + var pp = $rootScope.$on("process-push", function () { NVRDataModel.debug("*** PROCESS PUSH HANDLER CALLED INSIDE PORTAL LOGIN, setting ProcessPush to true"); processPush = true; evaluateTappedNotification(); }); + broadcastHandles.push(pp); function evaluateTappedNotification() { |
