diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js index ada3c78f8..8c8148967 100644 --- a/src/public/javascripts/services/tree.js +++ b/src/public/javascripts/services/tree.js @@ -17,11 +17,11 @@ import Branch from '../entities/branch.js'; import NoteShort from '../entities/note_short.js'; const $tree = $("#tree"); -const $parentList = $("#parent-list"); -const $parentListList = $("#parent-list-inner"); const $createTopLevelNoteButton = $("#create-top-level-note-button"); const $collapseTreeButton = $("#collapse-tree-button"); const $scrollToCurrentNoteButton = $("#scroll-to-current-note-button"); +const $notePathList = $("#note-path-list"); +const $notePathCount = $("#note-path-count"); let startNotePath = null; @@ -189,12 +189,13 @@ async function showParentList(noteId, node) { const note = await treeCache.getNote(noteId); const parents = await note.getParentNotes(); + $notePathCount.html(parents.length + " path" + (parents.length > 0 ? "s" : "")); + if (parents.length <= 1) { - $parentList.hide(); } else { - $parentList.show(); - $parentListList.empty(); + //$notePathList.show(); + $notePathList.empty(); for (const parentNote of parents) { const parentNotePath = await getSomeNotePath(parentNote); @@ -202,16 +203,13 @@ async function showParentList(noteId, node) { const notePath = parentNotePath ? (parentNotePath + '/' + noteId) : noteId; const title = await treeUtils.getNotePathTitle(notePath); - let item; + const item = $("
").append(await linkService.createNoteLink(notePath, title)); if (node.getParent().data.noteId === parentNote.noteId) { - item = $("").attr("title", "Current note").append(title); - } - else { - item = await linkService.createNoteLink(notePath, title); + item.addClass("current"); } - $parentListList.append($("").append(item)); + $notePathList.append(item); } } } diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index a0bd5f061..4ce0b0cd3 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -175,20 +175,6 @@ div.ui-tooltip { margin-top: 10px; } -#parent-list { - display: none; - margin-left: 20px; - border-top: 2px solid #eee; - padding-top: 10px; - grid-area: parent-list; - max-height: 300px; - overflow: auto; -} - -#parent-list ul { - padding-left: 20px; -} - /* * .electron-in-page-search-window is a class specified to default *Note locations:
- -