diff --git a/src/public/app/widgets/attribute_editor.js b/src/public/app/widgets/attribute_editor.js index 018967198..80c0054be 100644 --- a/src/public/app/widgets/attribute_editor.js +++ b/src/public/app/widgets/attribute_editor.js @@ -53,7 +53,7 @@ const TPL = `
- + @@ -200,6 +200,8 @@ export default class AttributeEditorWidget extends TabAwareWidget { this.attributeDetailWidget.hide(); }); + this.$editor.on('blur', () => this.save()); + this.$addNewAttributeButton = this.$widget.find('.add-new-attribute-button'); this.$addNewAttributeButton.on('click', e => this.addNewAttribute(e)); @@ -257,7 +259,7 @@ export default class AttributeEditorWidget extends TabAwareWidget { isInheritable: false }); - await this.renderOwnedAttributes(attrs); + await this.renderOwnedAttributes(attrs, false); this.$editor.scrollTop(this.$editor[0].scrollHeight); @@ -398,10 +400,10 @@ export default class AttributeEditorWidget extends TabAwareWidget { } async refreshWithNote(note) { - await this.renderOwnedAttributes(note.getOwnedAttributes()); + await this.renderOwnedAttributes(note.getOwnedAttributes(), true); } - async renderOwnedAttributes(ownedAttributes, ) { + async renderOwnedAttributes(ownedAttributes, saved) { const $attributesContainer = $("