From 35f62ffa67a37ea7fad0e2dc880b66819aa58ec7 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Thu, 19 Sep 2013 15:17:21 +0200 Subject: [PATCH] List view editor: makes bulk publish work --- .../listview/listview.controller.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index ab3791f1db..e30008e412 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -129,7 +129,22 @@ angular.module("umbraco") }; $scope.publish = function () { - + $scope.bulkStatus = "Starting with publish"; + var current = 1; + var total = $scope.selected.length; + for (var i = 0; i < $scope.selected.length; i++) { + contentResource.getById($scope.selected[i]).then(function(content) { + contentResource.publish(content, false) + .then(function(content){ + $scope.bulkStatus = "Publishing doc" + i + " out of " + total + "documents"; + if (current == total) { + $scope.bulkStatus = "Publish done"; + $scope.reloadView($scope.content.id); + } + current++; + }); + }); + } }; $scope.unpublish = function () {