List view editor: disable bulk actions if action is in progress
This commit is contained in:
@@ -3,6 +3,7 @@ angular.module("umbraco")
|
||||
function ($rootScope, $scope, $routeParams, contentResource, contentTypeResource, editorContextService, notificationsService) {
|
||||
|
||||
$scope.selected = [];
|
||||
$scope.actionInProgress = false;
|
||||
|
||||
$scope.options = {
|
||||
pageSize: 10,
|
||||
@@ -112,6 +113,7 @@ angular.module("umbraco")
|
||||
};
|
||||
|
||||
$scope.delete = function () {
|
||||
$scope.actionInProgress = true;
|
||||
$scope.bulkStatus = "Starting with delete";
|
||||
var current = 1;
|
||||
var total = $scope.selected.length;
|
||||
@@ -123,6 +125,7 @@ angular.module("umbraco")
|
||||
$scope.bulkStatus = "";
|
||||
$scope.selected = [];
|
||||
$scope.reloadView($scope.content.id);
|
||||
$scope.actionInProgress = false;
|
||||
}
|
||||
current++;
|
||||
});
|
||||
@@ -131,6 +134,7 @@ angular.module("umbraco")
|
||||
};
|
||||
|
||||
$scope.publish = function () {
|
||||
$scope.actionInProgress = true;
|
||||
$scope.bulkStatus = "Starting with publish";
|
||||
var current = 1;
|
||||
var total = $scope.selected.length;
|
||||
@@ -144,6 +148,7 @@ angular.module("umbraco")
|
||||
notificationsService.success("Bulk action", "Published " + total + "documents");
|
||||
$scope.bulkStatus = "";
|
||||
$scope.reloadView($scope.content.id);
|
||||
$scope.actionInProgress = false;
|
||||
}
|
||||
current++;
|
||||
});
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
|
||||
<div class="btn-group" ng-show="isAnythingSelected()">
|
||||
<a class="btn btn-success" ng-click="publish()" prevent-default>Publish</a>
|
||||
<a class="btn btn-success" ng-disabled="actionInProgress" ng-click="publish()" prevent-default>Publish</a>
|
||||
</div>
|
||||
<div class="btn-group" ng-show="isAnythingSelected()">
|
||||
<a class="btn btn-warning" ng-click="unpublish()" prevent-default>Unpublish</a>
|
||||
<a class="btn btn-warning" ng-disabled="actionInProgress" ng-click="unpublish()" prevent-default>Unpublish</a>
|
||||
</div>
|
||||
<div class="btn-group" ng-show="isAnythingSelected()">
|
||||
<a class="btn btn-danger" ng-click="delete()" prevent-default>Delete</a>
|
||||
<a class="btn btn-danger" ng-disabled="actionInProgress" ng-click="delete()" prevent-default>Delete</a>
|
||||
</div>
|
||||
<span ng-bind="bulkStatus" ng-show="isAnythingSelected()"></span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user