summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorlucas_nz <lucas_nz@outlook.com>2020-09-30 18:04:27 +1300
committerlucas_nz <lucas_nz@outlook.com>2020-09-30 18:08:33 +1300
commit8968a524a2df044b3f90d1c6fce110993eb8cf85 (patch)
tree71f10a07b76254bea734784da456dd2e79f17b77 /www
parentb321c0ee139571530a685edc187e29055b099789 (diff)
1. If scope.id is not zero, we should show "tick" only the filtered monitors on the filter view.
2. Make sure we clear the selections properly too
Diffstat (limited to 'www')
-rw-r--r--www/js/EventCtrl.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index b770dd7c..be1bf1f9 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -227,6 +227,11 @@ angular.module('zmApp.controllers')
$rootScope.fromString = "";
$rootScope.toString = "";
$rootScope.monitorsFilter="";
+ for (var i=0; i < $scope.monitors.length; i++) {
+ if ($scope.monitors[i] != undefined) {
+ $scope.monitors[i].Monitor.isChecked = undefined;
+ }
+ }
}
});
@@ -550,6 +555,19 @@ angular.module('zmApp.controllers')
nolangFrom = moment($rootScope.fromString).locale('en').format("YYYY-MM-DD HH:mm:ss");
if ($rootScope.toString)
nolangTo = moment($rootScope.toString).locale('en').format("YYYY-MM-DD HH:mm:ss");
+ if ($scope.id) {
+ $rootScope.monitorsFilter = "/MonitorId =:" + $scope.id;
+ //console.log("monitors.length: " + $scope.monitors.length);
+ for (var i=0; i < $scope.monitors.length; i++) {
+ if ($scope.monitors[i] != undefined) {
+ if ($scope.monitors[i].Monitor.Id == $scope.id)
+ $scope.monitors[i].Monitor.isChecked = true;
+ else
+ $scope.monitors[i].Monitor.isChecked = false;
+ }
+ }
+ $scope.id = 0;
+ }
NVR.getEvents($scope.id, currEventsPage, "", nolangFrom, nolangTo, false, $rootScope.monitorsFilter)
.then(function (data) {
@@ -2083,6 +2101,11 @@ angular.module('zmApp.controllers')
$scope.id = 0;
$scope.showEvent = false;
$scope.footerState = ionPullUpFooterState.MINIMIZED;
+ for (var i=0; i < $scope.monitors.length; i++) {
+ if ($scope.monitors[i] != undefined) {
+ $scope.monitors[i].Monitor.isChecked = undefined;
+ }
+ }
getInitialEvents();
/*