added sort direction change functionality

This commit is contained in:
cubedro
2015-04-06 07:05:49 +03:00
parent a5ee09ee69
commit bd7fdce9e7
2 changed files with 24 additions and 11 deletions

View File

@@ -28,6 +28,19 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
$scope.predicate = 'info.name';
$scope.reverse = false;
$scope.orderTable = function(predicate, reverse)
{
if(predicate != $scope.predicate)
{
$scope.reverse = reverse;
$scope.predicate = predicate;
}
else
{
$scope.reverse = !$scope.reverse;
}
}
$scope.timeout = setInterval(function(){
$scope.$apply();
}, 1000);