feat(share): expand subchildren when in folder

This commit is contained in:
Elian Doran 2025-06-09 15:02:50 +03:00
parent 091ffdeb59
commit 157b4f9398
No known key found for this signature in database

View File

@ -19,7 +19,7 @@ const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : "
<% <%
const hasChildren = childNote.hasVisibleChildren(); const hasChildren = childNote.hasVisibleChildren();
const isAncestorOfActive = ancestors.some(p => p === childNote.noteId); const isAncestorOfActive = ancestors.some(p => p === childNote.noteId);
const expandedClass = isAncestorOfActive ? " expanded" : ""; const expandedClass = childNote.noteId === activeNote.noteId || isAncestorOfActive ? " expanded" : "";
%> %>
<li class="<% if (hasChildren) { %>submenu-<% } %>item<%= expandedClass %>"> <li class="<% if (hasChildren) { %>submenu-<% } %>item<%= expandedClass %>">
<%- include('tree_item', {note: childNote, subRoot: subRoot}) %> <%- include('tree_item', {note: childNote, subRoot: subRoot}) %>