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
commit 4eaa12dd48
2 changed files with 4 additions and 6 deletions

View File

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

View File

@ -60,7 +60,7 @@
$scope.$watchCollection('associate_hosts', function () {
if($scope.selectedItems) {
$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;
}
});