mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
tweaks to note map
This commit is contained in:
@@ -151,6 +151,19 @@ function getGlobalTreeMap(req) {
|
||||
|
||||
const notes = mapRootNote.getSubtreeNotes(false)
|
||||
.filter(note => !note.hasLabel('excludeFromTreeMap'))
|
||||
.filter(note => {
|
||||
if (note.type !== 'image' || note.getChildNotes().length > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const imageLinkRelation = note.getTargetRelations().find(rel => rel.name === 'imageLink');
|
||||
|
||||
if (!imageLinkRelation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !note.getParentNotes().find(parentNote => parentNote.noteId === imageLinkRelation.noteId);
|
||||
})
|
||||
.map(note => [
|
||||
note.noteId,
|
||||
note.isContentAvailable() ? note.title : '[protected]',
|
||||
@@ -169,8 +182,7 @@ function getGlobalTreeMap(req) {
|
||||
links.push({
|
||||
id: branch.branchId,
|
||||
sourceNoteId: branch.parentNoteId,
|
||||
targetNoteId: branch.noteId,
|
||||
name: 'branch'
|
||||
targetNoteId: branch.noteId
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user