Skip to content

Commit

Permalink
Fix select all with pagination on Services
Browse files Browse the repository at this point in the history
  • Loading branch information
FLinares committed Sep 30, 2015
1 parent 26e58bb commit 7e9bafc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion views/reports/_attachments/scripts/hosts/controllers/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ angular.module('faradayApp')
$scope.workspace = $routeParams.wsId;
//ID of current host
var hostId = $routeParams.hidId;

$scope.sortField = "name";

// load all workspaces
workspacesFact.list().then(function(wss) {
$scope.workspaces = wss;
Expand Down Expand Up @@ -314,7 +317,10 @@ angular.module('faradayApp')
$scope.checkAllServices = function() {
$scope.selectall = !$scope.selectall;

angular.forEach($filter('filter')($scope.services, $scope.query), function(service) {
var tmp_services = $filter('orderObjectBy')($scope.services, $scope.sortField, $scope.reverse);
tmp_services = $filter('filter')(tmp_services, $scope.expression);
tmp_services = tmp_services.splice($scope.pageSize * $scope.currentPage, $scope.pageSize);
tmp_services.forEach(function(service) {
service.selected = $scope.selectall;
});
};
Expand Down

0 comments on commit 7e9bafc

Please sign in to comment.