From 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 19 八月 2022 01:15:31 +0800 Subject: [PATCH] 2022-08-19 --- src/menu/components/card/cardcellcomponent/index.jsx | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index cd73458..efcc4af 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -66,7 +66,6 @@ } componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('submitModal', this.handleSave) MKEmitter.addListener('cardAddElement', this.cardAddElement) MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) @@ -95,7 +94,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('submitModal', this.handleSave) MKEmitter.removeListener('cardAddElement', this.cardAddElement) MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) @@ -141,8 +139,6 @@ } handleStyle = (element) => { - const { cards, cardCell } = this.props - let _style = element.style ? fromJS(element.style).toJS() : {} let options = ['font', 'border', 'padding', 'margin', 'background'] @@ -169,14 +165,11 @@ card: element }) - MKEmitter.emit('changeStyle', [cards.uuid, cardCell.uuid, element.uuid], options, _style) + MKEmitter.emit('changeStyle', options, _style, this.getStyle) } - getStyle = (comIds, style) => { - const { cards, cardCell } = this.props + getStyle = (style) => { const { card, elements } = this.state - - if (comIds.length !== 3 || comIds[0] !== cards.uuid || comIds[1] !== cardCell.uuid || !card) return // if (card.eleType === 'button') { // if ((style.paddingLeft || style.paddingRight) && !style.width) { -- Gitblit v1.8.0