Skip to content

Commit

Permalink
Reload the recycle bin when deleting an item (umbraco#3820)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac authored and nul800sebastiaan committed Dec 9, 2018
1 parent 7149ebc commit 8747816
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio
var recycleBin = treeService.getDescendantNode(rootNode, -20);
if (recycleBin) {
recycleBin.hasChildren = true;
//reload the recycle bin if it's already expanded so the deleted item is shown
if (recycleBin.expanded) {
treeService.loadNodeChildren({ node: recycleBin, section: "content" });
}
}
}

//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) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
var recycleBin = treeService.getDescendantNode(rootNode, -21);
if (recycleBin) {
recycleBin.hasChildren = true;
//reload the recycle bin if it's already expanded so the deleted item is shown
if (recycleBin.expanded) {
treeService.loadNodeChildren({ node: recycleBin, section: "media" });
}
}
}

Expand Down

0 comments on commit 8747816

Please sign in to comment.