1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 15:34:26 +02:00

Refactor component API a bit

This commit is contained in:
Toby Zerner
2015-06-26 19:09:43 +09:30
parent 4dbe87da77
commit e18d8b35e5
9 changed files with 33 additions and 32 deletions

View File

@@ -25,20 +25,16 @@ export default class ComposerBody extends Component {
view(className) {
this.editor.props.disabled = this.loading() || !this.ready();
return m('div', {className, config: this.onload.bind(this)}, [
return m('div', {className}, [
avatar(this.props.user, {className: 'composer-avatar'}),
m('div.composer-body', [
m('ul.composer-header', listItems(this.headerItems().toArray())),
m('div.composer-editor', this.editor.view())
m('div.composer-editor', this.editor.render())
]),
LoadingIndicator.component({className: 'composer-loading'+(this.loading() ? ' active' : '')})
]);
}
onload(element) {
this.element(element);
}
focus() {
this.ready(true);
m.redraw(true);