diff options
| -rw-r--r-- | www/js/EventCtrl.js | 65 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 2 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 4 |
3 files changed, 37 insertions, 34 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 409ecae6..cc50f586 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -108,25 +108,12 @@ angular.module('zmApp.controllers') }); function scrollTo(eventNum, eventPos) { - var eventHeightCounter = 0; - var i = 0; - var lastEventHeight = 0; - //loop until we pass the event... - for (i = 0; i < $scope.events.length; i++) { - lastEventHeight = getRowHeight($scope.events[i]); - if ( i >= eventNum ) { - //$scope.navTitle = ($scope.events[i].Event.humanizeTime); // we don't need to update the navTitle as we're staying in the same place - break; - } - //console.log(getRowHeight($scope.events[i])); - eventHeightCounter = eventHeightCounter + lastEventHeight; - } - var scrl = eventHeightCounter + (lastEventHeight * eventPos); - //console.log("eventHeightCounter: " + eventHeightCounter + " lastEventHeight: " + lastEventHeight + ", scrl To " + scrl + ", len: " + $scope.events.length); - NVR.debug("scrollTo: " + scrl); - $ionicScrollDelegate.$getByHandle("mainScroll").scrollTo(0, scrl, false); - } - + var scrl = (eventRowHeight * eventNum) + (eventRowHeight * eventPos); + //console.log("eventNum: " + eventNum + " eventPos: " + eventPos + ", scrl To " + scrl); + //NVR.debug("scrollTo: " + scrl); + $ionicScrollDelegate.$getByHandle("mainScroll").scrollTo(0, scrl, false); + } + function getRowHeight(event) { var scrubHeight = 274; return event.Event.ShowScrub ? eventRowHeight + scrubHeight : eventRowHeight; @@ -137,7 +124,7 @@ angular.module('zmApp.controllers') var tempMonHeight = 0; monitorHeight = 0; for (var i=0; i < $scope.monitors.length; i++) { - if ($scope.monitors[i] != undefined && $scope.monitors[i].Monitor.isChecked) { + if ($scope.monitors[i] != undefined) { var mw = $scope.monitors[i].Monitor.Width; var mh = $scope.monitors[i].Monitor.Height; var mo = $scope.monitors[i].Monitor.Orientation; @@ -636,20 +623,36 @@ angular.module('zmApp.controllers') if ($rootScope.toString) nolangTo = moment($rootScope.toString).locale('en').format("YYYY-MM-DD HH:mm:ss"); - if ($scope.id) + if ($scope.id) { $rootScope.monitorsFilter = "/MonitorId =:" + $scope.id; - if ($rootScope.monitorsFilter == undefined || $rootScope.monitorsFilter == '' || $scope.id) { - for (var i=0; i < $scope.monitors.length; i++) { - if ($scope.monitors[i] != undefined) { - if ($rootScope.monitorsFilter == undefined || $rootScope.monitorsFilter == '' || $scope.monitors[i].Monitor.Id == $scope.id) - $scope.monitors[i].Monitor.isChecked = true; - else - $scope.monitors[i].Monitor.isChecked = false; + $scope.id = 0; + } + + if ($rootScope.monitorsFilter != undefined && $rootScope.monitorsFilter != '') { + NVR.debug("dorefresh monitorsFilter: " + $rootScope.monitorsFilter); + var monitorIds = []; + ($rootScope.monitorsFilter.split("/")).forEach(function(monitorId, index) { + //console.log('Index: ' + index + ' Value: ' + monitorId); + //skip the first one as it's always blank + if (index) + monitorIds.push(monitorId.split(":")[1]); + }); + var checked = true; + //if include listed monitors + if ($rootScope.monitorsFilter.includes("!=")) { + checked = false; + } + for (var i=0; i < $scope.monitors.length; i++) { + if ($scope.monitors[i] != undefined) { + if (monitorIds.includes($scope.monitors[i].Monitor.Id)) + $scope.monitors[i].Monitor.isChecked = checked; + else + $scope.monitors[i].Monitor.isChecked = !checked; + } } } - } - if ($scope.id) - $scope.id = 0; + + setRowHeight(); diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index de0f74c9..a5103b90 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -19,7 +19,7 @@ </ion-scroll> </div> - <ion-scroll has-bouncing=false min-zoom=1 zooming="true" direction="xy" delegate-handle="imgscroll" + <ion-scroll has-bouncing=false min-zoom="1" max-zoom="50" zooming="true" direction="xy" delegate-handle="imgscroll" overflow-scroll="false" scrollbar-x="false" scrollbar-y="false"> <div id="full-screen-event" style="height: 100vh;"> diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index 0da43cfd..69b25323 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -3,8 +3,8 @@ <ion-content ng-cloak on-double-tap="closeModal();" scroll="false" class="notch-ready"> <div id="imagecontainer"> - <ion-scroll on-scroll="checkZoom()" delegate-handle="imgscroll" has-bouncing=false min-zoom=1 - zooming="true" direction="xy" style="width: 100%;" overflow-scroll="false"> + <ion-scroll on-scroll="checkZoom()" delegate-handle="imgscroll" has-bouncing=false min-zoom="1" + zooming="true" max-zoom="50" direction="xy" style="width: 100%;" overflow-scroll="false"> <!-- android needs this 100vh - otherwise max- does not work --> <!-- --> |
