mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 04:16:17 +01:00 
			
		
		
		
	fix displaying hidden notes in the note's children list #2664
This commit is contained in:
		@@ -58,10 +58,20 @@ class Note extends AbstractEntity {
 | 
				
			|||||||
        return this.children;
 | 
					        return this.children;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    getVisibleChildNotes() {
 | 
				
			||||||
 | 
					        console.log(this.children.filter(childNote => !childNote.hasLabel('shareHiddenFromTree')));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return this.children.filter(childNote => !childNote.hasLabel('shareHiddenFromTree'));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    hasChildren() {
 | 
					    hasChildren() {
 | 
				
			||||||
        return this.children && this.children.length > 0;
 | 
					        return this.children && this.children.length > 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    hasVisibleChildren() {
 | 
				
			||||||
 | 
					        return this.children && !!this.children.find(childNote => !childNote.hasLabel('shareHiddenFromTree'));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    getChildBranches() {
 | 
					    getChildBranches() {
 | 
				
			||||||
        return this.children.map(childNote => this.shaca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
 | 
					        return this.children.map(childNote => this.shaca.getBranchFromChildAndParent(childNote.noteId, this.noteId));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@
 | 
				
			|||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        <% } %>
 | 
					        <% } %>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <% if (note.hasChildren()) { %>
 | 
					        <% if (note.hasVisibleChildren()) { %>
 | 
				
			||||||
            <nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">
 | 
					            <nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">
 | 
				
			||||||
                <% if (!isEmpty) { %>
 | 
					                <% if (!isEmpty) { %>
 | 
				
			||||||
                    <hr>
 | 
					                    <hr>
 | 
				
			||||||
@@ -54,7 +54,7 @@
 | 
				
			|||||||
                <% } %>
 | 
					                <% } %>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <ul>
 | 
					                <ul>
 | 
				
			||||||
                    <% for (const childNote of note.getChildNotes()) { %>
 | 
					                    <% for (const childNote of note.getVisibleChildNotes()) { %>
 | 
				
			||||||
                        <li>
 | 
					                        <li>
 | 
				
			||||||
                            <a href="<%= childNote.shareId %>"
 | 
					                            <a href="<%= childNote.shareId %>"
 | 
				
			||||||
                               class="type-<%= childNote.type %>"><%= childNote.title %></a>
 | 
					                               class="type-<%= childNote.type %>"><%= childNote.title %></a>
 | 
				
			||||||
@@ -67,7 +67,7 @@
 | 
				
			|||||||
        <% } %>
 | 
					        <% } %>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <% if (subRoot.hasChildren()) { %>
 | 
					    <% if (subRoot.hasVisibleChildren()) { %>
 | 
				
			||||||
        <button id="toggleMenuButton"></button>
 | 
					        <button id="toggleMenuButton"></button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <nav id="menu">
 | 
					        <nav id="menu">
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user