summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-12-17 15:07:04 -0500
committerPliable Pixels <pliablepixels@gmail.com>2017-12-17 15:07:04 -0500
commitba6f5a401067c4a170aa2592707352b2ebb110ca (patch)
tree7de3d7b84da5ce68fc5a6aa99cc886841c0d998d /www/js
parent485deb664e46fb4c17b4042f8cc7f4012cd2e561 (diff)
jshint and changed sort by monitor name #570
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MomentCtrl.js24
-rw-r--r--www/js/MontageCtrl.js1
2 files changed, 17 insertions, 8 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 */