diff --git a/src/public/app/widgets/note_attributes.js b/src/public/app/widgets/note_attributes.js index 655d08b41..3e336d433 100644 --- a/src/public/app/widgets/note_attributes.js +++ b/src/public/app/widgets/note_attributes.js @@ -74,6 +74,17 @@ const mentionSetup = { const TPL = `
+ +
+
+ +
5 attributes
+ +
+
+
`; @@ -192,6 +255,18 @@ export default class NoteAttributesWidget extends TabAwareWidget { this.$attrExtrasMoreNotes = this.$widget.find('.attr-extras-more-notes'); this.initialized = this.initEditor(); + this.$expander = this.$widget.find('.attr-expander'); + this.$expander.on('click', () => { + if (this.$editor.is(":visible")) { + this.$editor.slideUp(); + } + else { + this.$editor.slideDown(); + } + }); + + this.$expanderText = this.$expander.find('.attr-expander-text'); + this.$editor.on('keydown', async e => { const keycode = (e.keyCode ? e.keyCode : e.which); @@ -228,11 +303,17 @@ export default class NoteAttributesWidget extends TabAwareWidget { this.$widget.removeClass("error"); this.$widget.removeAttr("title"); + this.$expander.removeClass("error"); + this.$expanderText.text(attrs.length + ' attributes'); + return attrs; } catch (e) { this.$widget.attr("title", e.message); this.$widget.addClass("error"); + + this.$expander.addClass("error"); + this.$expanderText.text(e.message); } }