fix delete with keyboard and context menu regarding the selection

This commit is contained in:
zadam
2019-06-13 22:55:06 +02:00
parent f1967fd466
commit 943b35fb7d
3 changed files with 14 additions and 8 deletions

View File

@@ -122,7 +122,13 @@ class TreeContextMenu {
clipboard.pasteInto(this.node);
}
else if (cmd === "delete") {
treeChangesService.deleteNodes(treeService.getSelectedNodes(true));
let notesToDelete = treeService.getSelectedNodes(true);
if (notesToDelete.length === 0) {
notesToDelete.push(this.node);
}
treeChangesService.deleteNodes(notesToDelete);
}
else if (cmd === "export") {
exportDialog.showDialog("subtree");