diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/MomentCtrl.js | 24 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 1 | ||||
| -rw-r--r-- | www/templates/moment-popover.html | 2 | ||||
| -rw-r--r-- | www/templates/moment.html | 2 |
4 files changed, 19 insertions, 10 deletions
diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js index 582d4343..6edc5dd3 100644 --- a/www/js/MomentCtrl.js +++ b/www/js/MomentCtrl.js @@ -1,11 +1,13 @@ /* jshint -W041 */ +/*jshint -W069 */ +/*jshint sub:true*/ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console, Masonry */ //https:///zm/api/events/index/AlarmFrames%20%3E=:1/StartTime%20%3E=:2017-12-16%2009:08:50.json?sort=TotScore&direction=desc -angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$translate', '$q', '$templateRequest', '$sce', '$compile', '$http', '$ionicLoading', 'zm', '$timeout', '$q', '$ionicPopover','$ionicPopup','message', function($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $translate, $q, $templateRequest, $sce, $compile, $http, $ionicLoading,zm, $timeout, $q, $ionicPopover, $ionicPopup, message) +angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$translate', '$templateRequest', '$sce', '$compile', '$http', '$ionicLoading', 'zm', '$timeout', '$q', '$ionicPopover','$ionicPopup','message', '$ionicScrollDelegate',function($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $translate, $templateRequest, $sce, $compile, $http, $ionicLoading,zm, $timeout, $q, $ionicPopover, $ionicPopup, message, $ionicScrollDelegate) { var timeFrom; @@ -103,7 +105,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ width: monitors[i].Monitor.Width, height:monitors[i].Monitor.Height, orientation:monitors[i].Monitor.Orientation - } + }; } } @@ -140,7 +142,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ } } //for if (collapseCount) { - $scope.moments[collapseId].Event.collapseCount = collapseCount + $scope.moments[collapseId].Event.collapseCount = collapseCount; } else { $scope.moments[collapseId].Event.collapseCount=""; } @@ -154,9 +156,13 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ masonry.once( 'layoutComplete', function( laidOutItems ) { $timeout ( function () {masonry.layout();},300); - } ) + } ); - $timeout ( function () {masonry.layout();},300); + $timeout ( function () { + masonry.layout(); + $ionicScrollDelegate.$getByHandle("moment-delegate").scrollTop(); + + },600); }; @@ -270,7 +276,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ $scope.getMoments = function (cond) { getMoments (cond); - } + }; function getMoments(sortCondition) { @@ -380,8 +386,10 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ // if we use any other condition, we need to first sort by cond and then time if (sortCondition != "StartTime") { + var ascordesc = true; + if (sortCondition == 'monitorName') ascordesc=false; console.log ("SORTING BY "+sortCondition); - moments = objSort(moments,[sortCondition, true],["dateObject", true]); + moments = objSort(moments,[sortCondition, ascordesc],["dateObject", true]); } @@ -411,7 +419,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ - }; + } $scope.$on('$ionicView.beforeLeave', function() { diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 49cd60cd..269581b9 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1,6 +1,7 @@ // Controller for the montage view /* jshint -W041 */ + /* jslint browser: true*/ /* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded, ConnectSDK, moment */ diff --git a/www/templates/moment-popover.html b/www/templates/moment-popover.html index 1d77483d..caf7a1d3 100644 --- a/www/templates/moment-popover.html +++ b/www/templates/moment-popover.html @@ -7,7 +7,7 @@ </a> - <a class="item" ng-href="" ng-click="popover.hide();getMoments('MonitorId');">{{'kMomentMenuByMonitor' | translate}}</a> + <a class="item" ng-href="" ng-click="popover.hide();getMoments('monitorName');">{{'kMomentMenuByMonitor' | translate}}</a> <a class="item" ng-href="" ng-click="popover.hide();getMoments('MaxScore');">{{'kMomentMenuByScore' | translate}}</a> diff --git a/www/templates/moment.html b/www/templates/moment.html index a4da87d4..4720fa28 100644 --- a/www/templates/moment.html +++ b/www/templates/moment.html @@ -12,7 +12,7 @@ <a class="button button-icon icon ion-android-more-vertical" ng-click="popover.show($event)" ;> </a> </ion-nav-buttons> - <ion-content class="padding" scroll-sista delegate-handle="none" overflow-scroll="false" mouse-wheel-scroll style="background-color:#444444" > + <ion-content class="padding" scroll-sista delegate-handle="moment-delegate" overflow-scroll="false" mouse-wheel-scroll style="background-color:#444444" > <div style="color:white" ng-if="!moments.length"> Nothing to show yet... |
