diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-12-15 14:22:57 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-12-15 14:22:57 -0500 |
| commit | f4c6ca2e3d1bc5f986d4a6907d06d3ea20e8c701 (patch) | |
| tree | be3b51d8090a37c2a973de6d8176b6cae261e805 /www/js/PortalLoginCtrl.js | |
| parent | 778d33929e90b9c454e3ee76e561bb40be66378c (diff) | |
#467 - initial support to launch external URLs to view specific event (and fixes for monitor)
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index a71aa83e..4500ff9e 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -269,10 +269,51 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic function evaluateTappedNotification() { - if ($rootScope.tappedNotification) + var ld = NVRDataModel.getLogin(); + + + if ($rootScope.tappedNotification == 2) { // url launch + NVRDataModel.debug("Came via app url launch with mid="+$rootScope.tappedMid); + NVRDataModel.debug("Came via app url launch with eid="+$rootScope.tappedEid); + $rootScope.tappedNotification = 0; + $ionicHistory.nextViewOptions( + { + disableBack: true + }); + + if (parseInt($rootScope.tappedMid) > 0) + { + NVRDataModel.debug("Going to live view "); + $state.go("app.monitors", + {}, + { + reload: true + }); + return; + + } + + else if (parseInt($rootScope.tappedEid) > 0) { + NVRDataModel.debug("Going to events with EID=" + $rootScope.tappedEid); + $state.go("app.events", + { + //"id": $rootScope.tappedEid, + "id": 0, + "playEvent": true + }, + { + reload: true + }); + return; + } + // go with monitor first, then event - just because I feel like ;) + + + } + else if ($rootScope.tappedNotification == 1) // push { - var ld = NVRDataModel.getLogin(); + NVRDataModel.log("Came via push tap. onTapScreen=" + ld.onTapScreen); //console.log ("***** NOTIFICATION TAPPED "); $rootScope.tappedNotification = 0; @@ -389,7 +430,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic NVRDataModel.getKeyConfigParams(1); NVRDataModel.getTimeZone(); EventServer.refresh(); - if ($rootScope.tappedNotification != 1) + if ($rootScope.tappedNotification == 0) { console.log ("NOTIFICATION TAPPED INSIDE CHECK IS "+$rootScope.tappedNotification); var statetoGo = $rootScope.lastState ? $rootScope.lastState : 'app.montage'; |
