resort attributes for display

This commit is contained in:
zadam
2022-06-19 12:18:13 +02:00
parent 981fac8e50
commit 5ed1631a35
2 changed files with 8 additions and 1 deletions

View File

@@ -640,13 +640,18 @@ class NoteShort {
return [];
}
return this.getAttributes()
const promotedAttrs = this.getAttributes()
.filter(attr => attr.isDefinition())
.filter(attr => {
const def = attr.getDefinition();
return def && def.isPromoted;
});
// attrs are not resorted if position changes after initial load
promotedAttrs.sort((a, b) => a.position < b.position ? -1 : 1);
return promotedAttrs;
}
hasAncestor(ancestorNoteId, visitedNoteIds = null) {