mirror of
https://github.com/zadam/trilium.git
synced 2026-02-18 03:34:31 +01:00
feat(tree): hide add button if subtree is hidden
This commit is contained in:
parent
92e6a29e70
commit
b6a6e78d01
@ -1843,10 +1843,12 @@ function buildEnhanceTitle() {
|
||||
}
|
||||
|
||||
// TODO: Deduplicate with server's notes.ts#getAndValidateParent
|
||||
const isSubtreeHidden = note.hasLabel("subtreeHidden");
|
||||
if (!["search", "launcher"].includes(note.type)
|
||||
&& !note.isOptions()
|
||||
&& !note.isLaunchBarConfig()
|
||||
&& !note.noteId.startsWith("_help")
|
||||
&& !isSubtreeHidden
|
||||
) {
|
||||
node.span.append(createChildTemplate.cloneNode());
|
||||
}
|
||||
@ -1889,7 +1891,7 @@ function buildEnhanceTitle() {
|
||||
}
|
||||
|
||||
// Add a badge with the number of items if it hides children.
|
||||
if (note.hasLabel("subtreeHidden")) {
|
||||
if (isSubtreeHidden) {
|
||||
const $badge = $(`<span class="note-indicator-icon subtree-hidden-badge">${note.getChildNoteIds().length}</span>`);
|
||||
$span.find(".fancytree-title").append($badge);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user