| | |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | | if (!style.borderBottomWidth) { |
| | | style.borderBottomWidth = '0px' |
| | | let _style = fromJS(style).toJS() |
| | | if (!_style.borderBottomWidth) { |
| | | _style.borderBottomWidth = '0px' |
| | | } |
| | | if (_style.fontFamily) { |
| | | if (_style.fontFamily.length === 0) { |
| | | delete _style.fontFamily |
| | | } else { |
| | | _style.fontFamily = _style.fontFamily.join(',') |
| | | } |
| | | } |
| | | if (_style.lineHeight === 2.8) { |
| | | delete _style.lineHeight |
| | | } |
| | | |
| | | let _config = {...this.props.config, headerStyle: style} |
| | | let _config = {...this.props.config, headerStyle: _style} |
| | | |
| | | this.props.updateComponent(_config) |
| | | } |
| | |
| | | changeStyle = () => { |
| | | const { config } = this.props |
| | | |
| | | let options = ['font', 'border', 'background', 'padding'] |
| | | let _style = config.headerStyle ? fromJS(config.headerStyle).toJS() : {} |
| | | let options = ['font', 'border', 'background', 'padding', 'fontFamily'] |
| | | |
| | | MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle) |
| | | _style.fontFamily = _style.fontFamily ? _style.fontFamily.split(',') : [] |
| | | _style.lineHeight = _style.lineHeight || 2.8 |
| | | |
| | | MKEmitter.emit('changeStyle', options, _style, this.getStyle) |
| | | } |
| | | |
| | | render() { |