List view editor, make bulk delete work
This commit is contained in:
@@ -111,6 +111,20 @@ angular.module("umbraco")
|
||||
return $scope.selected.length > 0;
|
||||
};
|
||||
|
||||
$scope.delete = function () {
|
||||
var current = 1;
|
||||
var total = $scope.selected.length;
|
||||
for (var i = 0; i < $scope.selected.length; i++) {
|
||||
contentResource.deleteById($scope.selected[i]).then(function (data) {
|
||||
current++;
|
||||
if (current == total) {
|
||||
$scope.reloadView($scope.content.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if($routeParams.id){
|
||||
$scope.pagination = new Array(100);
|
||||
$scope.listViewAllowedTypes = contentTypeResource.getAllowedTypes($routeParams.id);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<a class="btn btn-warning">Unpublish</a>
|
||||
</div>
|
||||
<div class="btn-group" ng-show="isAnythingSelected()">
|
||||
<a class="btn btn-danger">Delete</a>
|
||||
<a class="btn btn-danger" ng-click="delete()" prevent-default>Delete</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user