mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
have paths in "note paths" widget also sorted by priority
This commit is contained in:
@@ -47,16 +47,10 @@ export default class NotePathsWidget extends TabAwareWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
const pathSegments = treeService.parseNotePath(this.notePath);
|
||||
const activeNoteParentNoteId = pathSegments[pathSegments.length - 2]; // we know this is not root so there must be a parent
|
||||
|
||||
for (const parentNote of this.note.getParentNotes()) {
|
||||
const parentNotePath = treeService.getSomeNotePath(parentNote);
|
||||
// this is to avoid having root notes leading '/'
|
||||
const notePath = parentNotePath ? (parentNotePath + '/' + this.noteId) : this.noteId;
|
||||
const isCurrent = activeNoteParentNoteId === parentNote.noteId;
|
||||
|
||||
await this.addPath(notePath, isCurrent);
|
||||
for (const notePath of this.note.getSortedNotePaths(this.hoistedNoteId)) {
|
||||
const notePathStr = notePath.join('/');
|
||||
console.log(notePathStr, this.notePath, notePathStr === this.notePath);
|
||||
await this.addPath(notePathStr, notePathStr === this.notePath);
|
||||
}
|
||||
|
||||
const cloneLink = $("<div>")
|
||||
@@ -96,4 +90,10 @@ export default class NotePathsWidget extends TabAwareWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
await super.refresh();
|
||||
|
||||
this.$widget.find('.dropdown-toggle').dropdown('hide');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user