From 367da39bbbd15d41c09864d4087a504a1986b163 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 29 Jul 2015 15:18:23 +0200 Subject: [PATCH] wires up UI to show notifications for delete cancellation --- .../views/content/content.delete.controller.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js index d7ff1843c7..1d24fee190 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js @@ -6,7 +6,7 @@ * @description * The controller for deleting content */ -function ContentDeleteController($scope, contentResource, treeService, navigationService, editorState, $location) { +function ContentDeleteController($scope, contentResource, treeService, navigationService, editorState, $location, dialogService, notificationsService) { $scope.performDelete = function() { @@ -41,6 +41,20 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio } navigationService.hideMenu(); + }, function(err) { + + $scope.currentNode.loading = false; + + //check if response is ysod + if (err.status && err.status >= 500) { + dialogService.ysodDialog(err); + } + + if (err.data && angular.isArray(err.data.notifications)) { + for (var i = 0; i < err.data.notifications.length; i++) { + notificationsService.showNotification(err.data.notifications[i]); + } + } }); };