mirror of
https://github.com/zadam/trilium.git
synced 2026-01-14 18:44:25 +01:00
feat(tree): add tooltip when moving into hidden subtree
This commit is contained in:
parent
0f77caad69
commit
db57f3ff62
@ -1773,7 +1773,11 @@
|
||||
"clone-indicator-tooltip-single": "This note is cloned (1 additional parent: {{- parent}})",
|
||||
"shared-indicator-tooltip": "This note is shared publicly",
|
||||
"shared-indicator-tooltip-with-url": "This note is shared publicly at: {{- url}}",
|
||||
"subtree-hidden-tooltip": "{{count}} child notes that are hidden from the tree"
|
||||
"subtree-hidden-tooltip": "{{count}} child notes that are hidden from the tree",
|
||||
"subtree-hidden-moved-title_one": "{{count}} note moved to {{title}}",
|
||||
"subtree-hidden-moved-title_other": "{{count}} notes moved to {{title}}",
|
||||
"subtree-hidden-moved-description-collection": "Items in this collection are managed by its views.",
|
||||
"subtree-hidden-moved-description-other": "Items in this note are intentionally hidden."
|
||||
},
|
||||
"title_bar_buttons": {
|
||||
"window-on-top": "Keep Window on Top"
|
||||
|
||||
@ -555,6 +555,19 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
||||
} else if (data.hitMode === "after") {
|
||||
branchService.moveAfterBranch(selectedBranchIds, node.data.branchId);
|
||||
} else if (data.hitMode === "over") {
|
||||
const targetNote = froca.getNoteFromCache(node.data.noteId);
|
||||
if (targetNote?.hasLabel("subtreeHidden")) {
|
||||
toastService.showPersistent({
|
||||
id: `subtree-hidden-moved`,
|
||||
title: t("note_tree.subtree-hidden-moved-title", { count: selectedBranchIds.length, title: targetNote.title }),
|
||||
message: targetNote.type === "book"
|
||||
? t("note_tree.subtree-hidden-moved-description-collection")
|
||||
: t("note_tree.subtree-hidden-moved-description-other"),
|
||||
icon: "bx bx-hide",
|
||||
timeout: 5_000,
|
||||
});
|
||||
}
|
||||
|
||||
branchService.moveToParentNote(selectedBranchIds, node.data.branchId);
|
||||
} else {
|
||||
throw new Error(`Unknown hitMode '${data.hitMode}'`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user