From e3076881b748fff53690373f02211706b60fab79 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 21 Oct 2018 18:49:32 -0400 Subject: #725 moved evaluate tapped notification to service,trapped handler in all controllers --- www/js/NewsCtrl.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'www/js/NewsCtrl.js') diff --git a/www/js/NewsCtrl.js b/www/js/NewsCtrl.js index ba45fb0e..d9850080 100644 --- a/www/js/NewsCtrl.js +++ b/www/js/NewsCtrl.js @@ -27,6 +27,17 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro } }; + $scope.$on ( "process-push", function () { + NVRDataModel.debug (">> NewsCtrl: push handler"); + var s = NVRDataModel.evaluateTappedNotification(); + NVRDataModel.debug("tapped Notification evaluation:"+ JSON.stringify(s)); + $ionicHistory.nextViewOptions({ + disableAnimate:true, + disableBack: true + }); + $state.go(s[0],s[1],s[2]); + }); + //------------------------------------------------------------------------- // Lets make sure we set screen dim properly as we enter // The problem is we enter other states before we leave previous states -- cgit v1.2.3 From ff613f8e6210d2c4cd2f8deacc0096e18aff2fcd Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 22 Oct 2018 11:50:53 -0400 Subject: #725 move push handlers inside beforeEnter for better consistency --- www/js/NewsCtrl.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'www/js/NewsCtrl.js') diff --git a/www/js/NewsCtrl.js b/www/js/NewsCtrl.js index d9850080..180f70d7 100644 --- a/www/js/NewsCtrl.js +++ b/www/js/NewsCtrl.js @@ -27,16 +27,7 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro } }; - $scope.$on ( "process-push", function () { - NVRDataModel.debug (">> NewsCtrl: push handler"); - var s = NVRDataModel.evaluateTappedNotification(); - NVRDataModel.debug("tapped Notification evaluation:"+ JSON.stringify(s)); - $ionicHistory.nextViewOptions({ - disableAnimate:true, - disableBack: true - }); - $state.go(s[0],s[1],s[2]); - }); + //------------------------------------------------------------------------- // Lets make sure we set screen dim properly as we enter @@ -45,6 +36,22 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro // reset power state on exit as if it is called after we enter another // state, that effectively overwrites current view power management needs //------------------------------------------------------------------------ + + + $scope.$on ('$ionicView.beforeEnter', function () { + + $scope.$on ( "process-push", function () { + NVRDataModel.debug (">> NewsCtrl: push handler"); + var s = NVRDataModel.evaluateTappedNotification(); + NVRDataModel.debug("tapped Notification evaluation:"+ JSON.stringify(s)); + $ionicHistory.nextViewOptions({ + disableAnimate:true, + disableBack: true + }); + $state.go(s[0],s[1],s[2]); + }); + }); + $scope.$on('$ionicView.enter', function () { // console.log("**VIEW ** News Ctrl Entered"); NVRDataModel.setAwake(false); -- cgit v1.2.3