diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-12-23 20:03:44 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-12-23 20:03:44 -0500 |
| commit | 41e7abfd2ec68cf4c673dc87951669506b6f38c6 (patch) | |
| tree | de22ffdfa9e07834a74d409093904d7d248b8b42 /www | |
| parent | dc43da401f3a142561b294f3d28e1a6fb3fbafec (diff) | |
#570 persistent sort by
Diffstat (limited to 'www')
| -rwxr-xr-x | www/js/DataModel.js | 8 | ||||
| -rw-r--r-- | www/js/MomentCtrl.js | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 1c74255b..a748bc2d 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -172,6 +172,7 @@ angular.module('zmApp.controllers') 'momentGridSize': 40, 'momentMonitorFilter': [], 'enableMomentSubMenu': true, + 'momentArrangeBy': 'StartTime', }; @@ -1039,6 +1040,13 @@ angular.module('zmApp.controllers') loginData.momentMonitorFilter = JSON.stringify([]); } + + + if (typeof loginData.momentArrangeBy == 'undefined') { + + loginData.momentArrangeBy = "StartTime"; + + } diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js index fc598456..39351a36 100644 --- a/www/js/MomentCtrl.js +++ b/www/js/MomentCtrl.js @@ -617,6 +617,10 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ //---------------------------------------------------------------- $scope.getMoments = function (cond) { if (!cond) cond = momentType; + + var ld = NVRDataModel.getLogin(); + ld.momentArrangeBy = cond; + NVRDataModel.setLogin(ld); getMoments(cond); }; @@ -660,7 +664,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ $scope.type = $translate.instant('kMomentMenuByScore'); else if (sortCondition == 'StartTime') $scope.type = $translate.instant('kMomentMenuByTime'); - else if (sortCondition == 'MonitorId') + else if (sortCondition == 'monitorName') $scope.type = $translate.instant('kMomentMenuByMonitor'); $scope.apiurl = NVRDataModel.getLogin().apiurl; @@ -789,6 +793,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ $scope.loadingStatus = $translate.instant('kLoading'); $scope.gridSize = ld.momentGridSize; + momentType = ld.momentArrangeBy; //console.log ("---------->Filter before "+ld.momentMonitorFilter); try { |
