king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
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) {