mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
experimental hiding of images if they are included in the parent note
This commit is contained in:
@@ -389,7 +389,8 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
|
||||
node.data.isProtected = note.isProtected;
|
||||
node.data.noteType = note.type;
|
||||
node.folder = note.type === 'search' || note.getChildNoteIds().length > 0;
|
||||
node.folder = treeBuilder.getChildBranchesWithoutImages(note).length > 0
|
||||
|| note.type === 'search';
|
||||
node.icon = treeBuilder.getIcon(note);
|
||||
node.extraClasses = treeBuilder.getExtraClasses(note);
|
||||
node.title = (branch.prefix ? (branch.prefix + " - ") : "") + note.title;
|
||||
@@ -481,6 +482,15 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
// missing handling of things inherited from template
|
||||
noteIdsToReload.add(attr.noteId);
|
||||
}
|
||||
else if (attr.type === 'relation' && attr.name === 'imageLink') {
|
||||
const note = treeCache.getNoteFromCache(attr.noteId);
|
||||
|
||||
if (note && note.getChildNoteIds().includes(attr.value)) {
|
||||
// there's new/deleted imageLink betwen note and its image child - which can show/hide
|
||||
// the image (if there is a imageLink relation between parent and child then it is assumed to be "contained" in the note and thus does not have to be displayed in the tree)
|
||||
noteIdsToReload.add(attr.noteId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const branch of loadResults.getBranches()) {
|
||||
|
||||
Reference in New Issue
Block a user