mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
improved heuristic of displaing attributes in note list and tooltips #1558
This commit is contained in:
@@ -44,7 +44,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
||||
}
|
||||
|
||||
renderTitle(note) {
|
||||
const promotedDefAttrs = this.getPromotedDefinitionAttributes();
|
||||
const promotedDefAttrs = note.getPromotedDefinitionAttributes();
|
||||
|
||||
if (promotedDefAttrs.length === 0) {
|
||||
return { show: false };
|
||||
@@ -62,7 +62,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
||||
async refreshWithNote(note) {
|
||||
this.$container.empty();
|
||||
|
||||
const promotedDefAttrs = this.getPromotedDefinitionAttributes();
|
||||
const promotedDefAttrs = note.getPromotedDefinitionAttributes();
|
||||
const ownedAttributes = note.getOwnedAttributes();
|
||||
|
||||
if (promotedDefAttrs.length === 0) {
|
||||
@@ -104,20 +104,6 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
||||
this.toggleInt(true);
|
||||
}
|
||||
|
||||
getPromotedDefinitionAttributes() {
|
||||
if (this.note.hasLabel('hidePromotedAttributes')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.note.getAttributes()
|
||||
.filter(attr => attr.isDefinition())
|
||||
.filter(attr => {
|
||||
const def = attr.getDefinition();
|
||||
|
||||
return def && def.isPromoted;
|
||||
});
|
||||
}
|
||||
|
||||
async createPromotedAttributeCell(definitionAttr, valueAttr, valueName) {
|
||||
const definition = definitionAttr.getDefinition();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user