view() { var classes = { 'minimized': this.position() === Composer.PositionEnum.MINIMIZED, 'full-screen': this.position() === Composer.PositionEnum.FULLSCREEN }; classes.visible = this.position() === Composer.PositionEnum.NORMAL || classes.minimized || classes.fullScreen; if (this.component) this.component.props.disabled = classes.minimized; return m('div.composer', {config: this.onload.bind(this), className: classList(classes)}, [ m('div.composer-handle', {config: this.configHandle.bind(this)}), m('ul.composer-controls', listItems(this.controlItems().toArray())), m('div.composer-content', {onclick: () => { if (this.position() === Composer.PositionEnum.MINIMIZED) this.show(); }}, this.component ? this.component.view() : '') ]); }
view() { return m('label.yesno-control', [ m('input[type=checkbox]', { checked: this.props.state, disabled: this.props.disabled, onchange: m.withAttr('checked', this.onchange.bind(this)) }), m('div.yesno', {className: classList({ loading: this.loading(), disabled: this.props.disabled, state: this.props.state ? 'yes' : 'no' })}, [ this.loading() ? LoadingIndicator.component({size: 'tiny'}) : icon(this.props.state ? 'check' : 'times') ]) ]); }