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 * element for search window. @@ -249,7 +235,7 @@ div.ui-tooltip { filter: opacity(7%); } -.dropdown-menu li:not(.divider) { +#note-type .dropdown-menu li:not(.divider) { padding: 5px; width: 200px; } @@ -379,4 +365,8 @@ div.ui-tooltip { .btn.active { background-color: #ddd; +} + +#note-path-list .current a { + font-weight: bold; } \ No newline at end of file diff --git a/src/views/index.ejs b/src/views/index.ejs index 41a18a38a..a781c1df5 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -87,16 +87,24 @@
    - -
    -

    Note locations:

    - -
      -
      + + + + + + -   - - - - +     -