change tree node icon for selected notes to quickly bring up bulk action dialog

This commit is contained in:
zadam
2022-06-12 13:57:22 +02:00
parent 1bfc5fb77f
commit 4aaa0f8d8c
7 changed files with 31 additions and 123 deletions

View File

@@ -91,7 +91,7 @@ class TreeContextMenu {
enabled: notSearch && noSelectedNotes },
{ title: "Import into note", command: "importIntoNote", uiIcon: "bx bx-empty",
enabled: notSearch && noSelectedNotes },
{ title: "Bulk actions", command: "bulkActions", uiIcon: "bx bx-empty",
{ title: "Apply bulk actions", command: "openBulkActionsDialog", uiIcon: "bx bx-list-plus",
enabled: true }
].filter(row => row !== null);
}
@@ -130,16 +130,11 @@ class TreeContextMenu {
this.treeWidget.triggerCommand("openNewNoteSplit", {ntxId, notePath});
}
else {
const selectedOrActiveBranchIds = this.treeWidget.getSelectedOrActiveBranchIds(this.node);
const selectedOrActiveNoteIds = selectedOrActiveBranchIds
.map(branchId => froca.getBranch(branchId).noteId)
.filter(noteId => !!noteId);
this.treeWidget.triggerCommand(command, {
node: this.node,
notePath: notePath,
selectedOrActiveBranchIds,
selectedOrActiveNoteIds
selectedOrActiveBranchIds: this.treeWidget.getSelectedOrActiveBranchIds(this.node),
selectedOrActiveNoteIds: this.treeWidget.getSelectedOrActiveNoteIds(this.node)
});
}
}