Redirect to recycle bin after deletion

This commit is contained in:
Kenn Jacobsen
2018-12-08 10:43:26 +01:00
committed by Sebastiaan Janssen
parent 7c8ab96b51
commit 9f9286ae45
2 changed files with 7 additions and 3 deletions

View File

@@ -42,7 +42,9 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio
//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.toString() !== "-1")
if ($scope.currentNode.parentId.toString() === "-20")
location = "/content/content/recyclebin";
else if ($scope.currentNode.parentId.toString() !== "-1")
location = "/content/content/edit/" + $scope.currentNode.parentId;
$location.path(location);

View File

@@ -41,8 +41,10 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
if (editorState.current && editorState.current.id == $scope.currentNode.id) {
//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.toString() !== "-1")
var location = "/media";
if ($scope.currentNode.parentId.toString() === "-21")
location = "/media/media/recyclebin";
else if ($scope.currentNode.parentId.toString() !== "-1")
location = "/media/media/edit/" + $scope.currentNode.parentId;
$location.path(location);