List view editor: hooks in notification service

This commit is contained in:
Tim Geyssens
2013-09-19 16:03:42 +02:00
parent d7c0e897cf
commit 3d28db6897

View File

@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.Editors.ListViewController",
function ($rootScope, $scope, $routeParams, contentResource, contentTypeResource, editorContextService) {
function ($rootScope, $scope, $routeParams, contentResource, contentTypeResource, editorContextService, notificationsService) {
$scope.selected = [];
@@ -119,7 +119,8 @@ angular.module("umbraco")
contentResource.deleteById($scope.selected[i]).then(function (data) {
$scope.bulkStatus = "Deleted doc" + i + " out of "+ total +"documents";
if (current == total) {
$scope.bulkStatus = "Deleting done";
notificationsService.success("Bulk action", "Deleted " + total + "documents");
$scope.bulkStatus = "";
$scope.selected = [];
$scope.reloadView($scope.content.id);
}
@@ -139,7 +140,8 @@ angular.module("umbraco")
.then(function(content){
$scope.bulkStatus = "Publishing doc" + i + " out of " + total + "documents";
if (current == total) {
$scope.bulkStatus = "Publish done";
notificationsService.success("Bulk action", "Published " + total + "documents");
$scope.bulkStatus = "";
$scope.reloadView($scope.content.id);
}
current++;