| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | if (!is(fromJS(this.props.card), fromJS(nextProps.card))) { |
| | | setTimeout(() => { |
| | | if (nextProps.card.insert === 'true' && this.cardRef) { |
| | | if (nextProps.card.extraAction && this.cardRef) { |
| | | if (this.cardRef.offsetWidth !== this.state.cardwidth || this.cardRef.offsetHeight !== this.state.cardheight) { |
| | | this.setState({ |
| | | cardwidth: this.cardRef.offsetWidth, |
| | |
| | | componentDidMount() { |
| | | const { card } = this.props |
| | | |
| | | if (card.insert === 'true' && this.cardRef) { |
| | | if (card.extraAction && this.cardRef) { |
| | | this.setState({ |
| | | cardwidth: this.cardRef.offsetWidth, |
| | | cardheight: this.cardRef.offsetHeight |
| | |
| | | componentDidUpdate() { |
| | | const { card } = this.props |
| | | |
| | | if (card.insert === 'true' && this.cardRef) { |
| | | if (card.extraAction && this.cardRef) { |
| | | if (this.cardRef.offsetWidth !== this.state.cardwidth || this.cardRef.offsetHeight !== this.state.cardheight) { |
| | | this.setState({ |
| | | cardwidth: this.cardRef.offsetWidth, |
| | |
| | | </ul> : null |
| | | } |
| | | </div> |
| | | {card.insert === 'true' ? |
| | | {card.extraAction ? |
| | | <div className={'ant-card chart-card chart-card-insert' + outclass} style={{ width: cardwidth, height: cardheight }} > |
| | | <Icon type="plus" style={cardwidth > cardheight ? {fontSize: cardheight / 2 + 'px', lineHeight: cardheight + 'px'} : {fontSize: cardwidth / 2 + 'px', lineHeight: cardheight + 'px'}} /> |
| | | </div> : null |