improved heuristic of displaing attributes in note list and tooltips #1558

This commit is contained in:
zadam
2021-01-23 21:41:02 +01:00
parent 6408a47a8a
commit 7b0fd639f6
4 changed files with 33 additions and 17 deletions

View File

@@ -80,7 +80,19 @@ async function renderAttributes(attributes, renderIsInheritable) {
}
async function renderNormalAttributes(note) {
const attrs = note.getAttributes().filter(attr => !attr.isDefinition() && !attr.isAutoLink);
const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes();
let attrs = note.getAttributes();
if (promotedDefinitionAttributes.length > 0) {
attrs = attrs.filter(attr => !!promotedDefinitionAttributes.find(promAttr => promAttr.isDefinitionFor(attr)));
}
else {
attrs = attrs.filter(
attr => !attr.isDefinition()
&& !attr.isAutoLink
&& attr.noteId === note.noteId
);
}
const $renderedAttributes = await renderAttributes(attrs, false);