diff options
| -rw-r--r-- | www/js/EventCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 7 | ||||
| -rw-r--r-- | www/templates/events.html | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 45b750b2..85421126 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2814,6 +2814,9 @@ angular.module('zmApp.controllers') + + + $scope.showThumbnail = function (b,f) { if (!f) {// api update needed @@ -2859,6 +2862,11 @@ angular.module('zmApp.controllers') //earlier won't work //-------------------------------------------------------- + $scope.openModalWithSnapshot = function (event) { + openModal (event,'enabled'); + + }; + $scope.openModal = function(event) { @@ -2866,7 +2874,7 @@ angular.module('zmApp.controllers') }; - function openModal (event) { + function openModal (event, snapshot) { NVRDataModel.debug("unbinding eventCtrl watchers as modal has its own"); ionRangeWatcher(); mycarouselWatcher(); @@ -2891,6 +2899,8 @@ angular.module('zmApp.controllers') animation: 'slide-in-up', id: 'footage', showLive:sl, // seems bool is not allowed... + snapshot:snapshot, + eventId:event.Event.Id }) .then(function(modal) { diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 46fda660..5f37fa69 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -976,7 +976,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro if (m.snapshot == 'enabled') { isSnapShotEnabled = true; currentStreamState = streamState.SNAPSHOT; - maxAlarmFid = m.snapshotId; + if (m.snapshotId) maxAlarmFid = m.snapshotId; eventId = m.eventId; $scope.eventId = m.eventId; @@ -1480,12 +1480,13 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro NVRDataModel.debug ("Next is index:"+i+" maxScoreId:"+$scope.moments[i].Event.MaxScoreFrameId); maxAlarmFid = $scope.moments[i].Event.MaxScoreFrameId; eventId = $scope.moments[i].Event.Id; + return; } - if (currentStreamState == streamState.ACTIVE) { + if (1) { // NVRDataModel.log("using zms to move "); - if ($scope.defaultVideo == '' || $scope.defaultVideo == 'undefined') { + if (currentStreamState == streamState.ACTIVE && ($scope.defaultVideo == '' || $scope.defaultVideo == 'undefined')) { // need to kill zms currentStreamState = streamState.STOPPED; $timeout (function() { diff --git a/www/templates/events.html b/www/templates/events.html index fd7de60e..8d855e81 100644 --- a/www/templates/events.html +++ b/www/templates/events.html @@ -103,7 +103,7 @@ <img ng-image-appear transition-duration="0.3s" animation="fillIn" bg-color="#6C7A89" width="{{event.Event.thumbWidth}}px" height="{{event.Event.thumbHeight}}px" ng-src="{{event.Event.baseURL}}/index.php?view=image&fid={{event.Event.MaxScoreFrameId}}&width={{event.Event.thumbWidth*2}}&height={{event.Event.thumbHeight*2}}" - on-tap="showThumbnail(event.Event.baseURL,event.Event.MaxScoreFrameId)" /> + on-tap="closeIfOpen(event);openModalWithSnapshot(event)" /> <!--<p>{{event.Event.thumbWidth}}px*{{event.Event.thumbHeight}}px</p>--> |
