Skip to content

Commit

Permalink
Fix select all with pagination on Hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
FLinares committed Sep 30, 2015
1 parent 4ece2d1 commit 26e58bb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ angular.module('faradayApp')
$scope.hosts = [];
// current workspace
$scope.workspace = $routeParams.wsId;
$scope.sortField = "name";
// load all workspaces
workspacesFact.list().then(function(wss) {
$scope.workspaces = wss;
Expand Down Expand Up @@ -362,7 +363,10 @@ angular.module('faradayApp')
$scope.checkAll = function() {
$scope.selectall = !$scope.selectall;

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

0 comments on commit 26e58bb

Please sign in to comment.