mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 05:15:02 -02: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:
committed by
Jake McDermott
parent
6135056413
commit
242467cb99
@@ -39,7 +39,12 @@ function($scope, $rootScope, ProcessErrors, GetBasePath,
|
|||||||
$scope.selectedItems.push(item.id);
|
$scope.selectedItems.push(item.id);
|
||||||
}
|
}
|
||||||
else {
|
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"
|
<button type="button"
|
||||||
class="btn btn-sm Form-saveButton"
|
class="btn btn-sm Form-saveButton"
|
||||||
ng-click="updateUsers()"
|
ng-click="updateUsers()"
|
||||||
ng-disabled="!selectedItems || !selectedItems.length">
|
ng-disabled="!selectedItems || selectedItems.length === 0">
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user