| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('addButton', this.addButton) |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | /** |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('addButton', this.addButton) |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | | getStyle = (style) => { |
| | | const { config } = this.props |
| | | const { card, actionlist } = this.state |
| | | |
| | | if (comIds[0] !== config.uuid || comIds[1] !== 'actionlist') return |
| | | |
| | | let _card = fromJS(card).toJS() |
| | | _card.style = style |
| | |
| | | } |
| | | |
| | | changeBtnStyle = (element) => { |
| | | const { config } = this.props |
| | | |
| | | let _style = element.style ? fromJS(element.style).toJS() : {} |
| | | let options = ['font', 'border', 'background', 'margin', 'padding'] |
| | | |
| | |
| | | card: element |
| | | }) |
| | | |
| | | MKEmitter.emit('changeStyle', [config.uuid, 'actionlist', element.uuid], options, _style) |
| | | MKEmitter.emit('changeStyle', options, _style, this.getStyle) |
| | | } |
| | | |
| | | addButton = (cardId, element) => { |
| | |
| | | const { actionlist, visible, appType, card, dict, profVisible, record } = this.state |
| | | |
| | | return ( |
| | | <div className={'model-menu-action-list'}> |
| | | <div className={'model-menu-action-list length' + actionlist.length}> |
| | | <DragElement |
| | | list={actionlist} |
| | | type={appType === 'mob' ? (type || '') : ''} |