mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Fixes bug where selecting and deselecting users in the list was causing thes save button to be disabled improperly (#4533)
This commit is contained in:
parent
6135056413
commit
242467cb99
@ -39,7 +39,12 @@ function($scope, $rootScope, ProcessErrors, GetBasePath,
|
||||
$scope.selectedItems.push(item.id);
|
||||
}
|
||||
else {
|
||||
$scope.selectedItems = _.remove($scope.selectedItems, { id: item.id });
|
||||
// _.remove() Returns the new array of removed elements.
|
||||
// This will pull all the values out of the array that don't
|
||||
// match the deselected item effectively removing it
|
||||
$scope.selectedItems = _.remove($scope.selectedItems, function(selectedItem) {
|
||||
return selectedItem !== item.id;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-saveButton"
|
||||
ng-click="updateUsers()"
|
||||
ng-disabled="!selectedItems || !selectedItems.length">
|
||||
ng-disabled="!selectedItems || selectedItems.length === 0">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user