Reload the recycle bin when deleting an item (#3820)

This commit is contained in:
Kenn Jacobsen
2018-12-09 18:19:48 +01:00
committed by Sebastiaan Janssen
parent 7149ebcb68
commit 87478163ed
2 changed files with 9 additions and 1 deletions

View File

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

View File

@@ -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" });
}
}
}