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 be27f3a663..12da77e854 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 @@ -31,7 +31,13 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio //if the current edited item is the same one as we're deleting, we need to navigate elsewhere if (editorState.current && editorState.current.id == $scope.currentNode.id) { - $location.path("/content/content/edit/" + $scope.currentNode.parentId); + + //If the deleted item lived at the root then just redirect back to the root, otherwise redirect to the item's parent + var location = "/content"; + if ($scope.currentNode.parentId !== -1) + location = "/content/content/edit/" + $scope.currentNode.parentId; + + $location.path(location); } navigationService.hideMenu(); diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.delete.controller.js index 3b25411bf9..89a2920c49 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.delete.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.delete.controller.js @@ -34,7 +34,7 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer //If the deleted item lived at the root then just redirect back to the root, otherwise redirect to the item's parent var location = "/media"; - if ($scope.currentNode.parentId != -1) + if ($scope.currentNode.parentId !== -1) location = "/media/media/edit/" + $scope.currentNode.parentId; $location.path(location);