king
2022-09-06 bdfec44c9f3a37dbbe05bf14a252ffec04132a86
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) {
@@ -430,6 +423,7 @@
          res.eleType = cell.eleType || null
          res.style = cell.style || null
          res.modal = cell.modal || null
          res.wrapStyle = cell.wrapStyle || null
          // res = {...cell, ...res}
          // if (!res.control) {