From cc8c477b166b53f8f4e9908fc2008a40e953d40d Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Thu, 19 Sep 2013 14:58:32 +0200 Subject: [PATCH] List view editor, make bulk delete work --- .../listview/listview.controller.js | 14 ++++++++++++++ .../views/propertyeditors/listview/listview.html | 2 +- 2 files changed, 15 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 86738d265d..f1f9a84c38 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 @@ -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); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html index 2c683a6cfe..504f718c33 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html @@ -23,7 +23,7 @@ Unpublish
- Delete + Delete