From f4c6ca2e3d1bc5f986d4a6907d06d3ea20e8c701 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 15 Dec 2017 14:22:57 -0500 Subject: #467 - initial support to launch external URLs to view specific event (and fixes for monitor) --- www/js/EventCtrl.js | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'www/js/EventCtrl.js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index e12d2f32..26d47d33 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -121,10 +121,34 @@ angular.module('zmApp.controllers') getInitialEvents(); setupWatchers(); footerExpand(); + // now do event playback if asked + + if (parseInt($rootScope.tappedEid) > 0) { + NVRDataModel.debug (" Trying ot live play " + $rootScope.tappedEid); + playSpecificEvent($rootScope.tappedEid); + + } + },100); }); + + function playSpecificEvent (eid) { + NVRDataModel.log ("Stuffing EID to play back "+ eid); + $rootScope.tappedEid = 0; + var event = { + Event: { + Id:eid + } + + }; + $scope.event = event; + $scope.currentEvent = event; + openModal(event); + + } + $scope.$on('$ionicView.beforeEnter', function() { @@ -140,6 +164,8 @@ angular.module('zmApp.controllers') NVRDataModel.log("EventCtrl called with: EID=" + $scope.id + " playEvent = " + $scope.showEvent); + + // This is the only view that hardcodes row size due to // collection repeat, so lets re-get the text size if it has changed // note that there may be a delay as its a callback - so might involve @@ -2778,6 +2804,11 @@ angular.module('zmApp.controllers') $scope.openModal = function(event) { + openModal(event); + + }; + + function openModal (event) { NVRDataModel.debug("unbinding eventCtrl watchers as modal has its own"); ionRangeWatcher(); mycarouselWatcher(); @@ -2812,8 +2843,7 @@ angular.module('zmApp.controllers') var ld = NVRDataModel.getLogin(); }); - - }; + } //-------------------------------------------------------- //We need to destroy because we are instantiating -- cgit v1.2.3