for a case when note's content is pure text (e.g. "[protected]") which
// then fails the jquery non-empty text test
content += '
' + noteComplement.content + '
';
}
- else if (note.type === 'code') {
+ else if (note.type === 'code' && noteComplement.content && noteComplement.content.trim()) {
content += $("
")
.text(noteComplement.content)
.prop('outerHTML');
@@ -133,10 +139,6 @@ async function renderTooltip(note, noteComplement) {
}
// other types of notes don't have tooltip preview
- if (!$(content).text().trim() && note.type !== 'image') {
- return "";
- }
-
return content;
}
diff --git a/src/public/javascripts/widgets/attributes.js b/src/public/javascripts/widgets/attributes.js
index 2ad3fe358..80b860d86 100644
--- a/src/public/javascripts/widgets/attributes.js
+++ b/src/public/javascripts/widgets/attributes.js
@@ -34,7 +34,7 @@ export default class AttributesWidget extends CollapsibleWidget {
.attr("href", "javascript:")
.text("+show inherited")
.on('click', async () => {
- const attributes = await note.getAttributes();
+ const attributes = note.getAttributes();
const inheritedAttributes = attributes.filter(attr => attr.noteId !== this.noteId);
if (inheritedAttributes.length === 0) {
diff --git a/src/public/javascripts/widgets/promoted_attributes.js b/src/public/javascripts/widgets/promoted_attributes.js
index 56d6404da..8c9e71209 100644
--- a/src/public/javascripts/widgets/promoted_attributes.js
+++ b/src/public/javascripts/widgets/promoted_attributes.js
@@ -40,10 +40,14 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
const attributes = note.getAttributes();
- const promoted = attributes.filter(attr =>
- (attr.type === 'label-definition' || attr.type === 'relation-definition')
- && !attr.name.startsWith("child:")
- && attr.value.isPromoted);
+ const promoted = attributes
+ .filter(attr => attr.type === 'label-definition' || attr.type === 'relation-definition')
+ .filter(attr => !attr.name.startsWith("child:"))
+ .filter(attr => {
+ const json = attr.jsonValue;
+
+ return json && json.isPromoted;
+ });
const hidePromotedAttributes = attributes.some(attr => attr.type === 'label' && attr.name === 'hidePromotedAttributes');
@@ -89,7 +93,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
}
async createPromotedAttributeRow(definitionAttr, valueAttr) {
- const definition = definitionAttr.value;
+ const definition = definitionAttr.jsonValue;
const $tr = $("");
const $labelCell = $("").append(valueAttr.name);
const $input = $("")
|