From 222b81e91710a638a2cfbe9a993b4c226e20480a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 14 May 2015 22:12:35 +0930 Subject: [PATCH] Make text editor's controller accessible --- .../js/forum/src/components/composer-body.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/framework/core/js/forum/src/components/composer-body.js b/framework/core/js/forum/src/components/composer-body.js index 41d2d8ecb..99897a629 100644 --- a/framework/core/js/forum/src/components/composer-body.js +++ b/framework/core/js/forum/src/components/composer-body.js @@ -11,6 +11,14 @@ export default class ComposerBody extends Component { this.loading = m.prop(false); this.disabled = m.prop(false); this.content = m.prop(this.props.originalContent); + this.editor = new TextEditor({ + submitLabel: this.props.submitLabel, + placeholder: this.props.placeholder, + disabled: this.loading(), + onchange: this.content, + onsubmit: this.onsubmit.bind(this), + value: this.content() + }); } view() { @@ -18,14 +26,7 @@ export default class ComposerBody extends Component { avatar(this.props.user, {className: 'composer-avatar'}), m('div.composer-body', [ m('ul.composer-header', listItems(this.headerItems().toArray())), - m('div.composer-editor', TextEditor.component({ - submitLabel: this.props.submitLabel, - placeholder: this.props.placeholder, - disabled: this.loading(), - onchange: this.content, - onsubmit: this.onsubmit.bind(this), - value: this.content() - })) + m('div.composer-editor', this.editor.view()) ]), LoadingIndicator.component({className: 'composer-loading'+(this.loading() ? ' active' : '')}) ]);