Merge pull request #7144 from mabashian/6954-host-associate

Fixed group/host association across pages
This commit is contained in:
Michael Abashian
2017-07-18 17:41:14 -04:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -63,12 +63,10 @@
$scope.$watchCollection('associate_groups', function () { $scope.$watchCollection('associate_groups', function () {
if($scope.selectedItems) { if($scope.selectedItems) {
$scope.associate_groups.forEach(function(row, i) { $scope.associate_groups.forEach(function(row, i) {
$scope.selectedItems.forEach(function(selectedItem) { if ($scope.selectedItems.filter(function(e) { return e.id === row.id; }).length > 0) {
if(selectedItem.id === row.id) {
$scope.associate_groups[i].isSelected = true; $scope.associate_groups[i].isSelected = true;
} }
}); });
});
} }
}); });

View File

@@ -60,7 +60,7 @@
$scope.$watchCollection('associate_hosts', function () { $scope.$watchCollection('associate_hosts', function () {
if($scope.selectedItems) { if($scope.selectedItems) {
$scope.associate_hosts.forEach(function(row, i) { $scope.associate_hosts.forEach(function(row, i) {
if (_.includes($scope.selectedItems, row.id)) { if ($scope.selectedItems.filter(function(e) { return e.id === row.id; }).length > 0) {
$scope.associate_hosts[i].isSelected = true; $scope.associate_hosts[i].isSelected = true;
} }
}); });