|
@@ -19,9 +19,6 @@ class AdverseReactions extends Component {
|
|
this.props.changeReact(it, index);
|
|
this.props.changeReact(it, index);
|
|
}
|
|
}
|
|
handleMouseEnterDrug(index, item) {
|
|
handleMouseEnterDrug(index, item) {
|
|
- const drugNameWidth = parseInt($('#'+item.id)[0].offsetWidth)
|
|
|
|
- const imgLeft = drugNameWidth/2-8
|
|
|
|
- $('#'+item.id).find('img').css('left', imgLeft)
|
|
|
|
this.setState({
|
|
this.setState({
|
|
currentIndex: index,
|
|
currentIndex: index,
|
|
})
|
|
})
|
|
@@ -61,19 +58,19 @@ class AdverseReactions extends Component {
|
|
<span className={style['last-treat-name-box']}
|
|
<span className={style['last-treat-name-box']}
|
|
|
|
|
|
>
|
|
>
|
|
- <span id={item.id}
|
|
|
|
|
|
+ <span
|
|
className={style['last-treat-big-name-box']}
|
|
className={style['last-treat-big-name-box']}
|
|
onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item)}
|
|
onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item)}
|
|
onMouseLeave = {this.handleMouseLeaveDrug}
|
|
onMouseLeave = {this.handleMouseLeaveDrug}
|
|
>
|
|
>
|
|
- {item.tagName}:
|
|
|
|
- {<img className={style['info-img']}
|
|
|
|
- style ={currentIndex === index ? {display: "inline-block"} : {display: "none"}}
|
|
|
|
- src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2}
|
|
|
|
- onMouseEnter={this.handleMouseEnterImg.bind(this)}
|
|
|
|
- onMouseLeave = {this.handleMouseLeaveImg}
|
|
|
|
- onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
|
|
|
|
-
|
|
|
|
|
|
+ <span className={style['last-treat-big-name']} >{item.tagName}:
|
|
|
|
+ {<img className={style['info-img']}
|
|
|
|
+ style ={currentIndex === index ? {display: "inline-block"} : {display: "none"}}
|
|
|
|
+ src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2}
|
|
|
|
+ onMouseEnter={this.handleMouseEnterImg.bind(this)}
|
|
|
|
+ onMouseLeave = {this.handleMouseLeaveImg}
|
|
|
|
+ onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
|
|
|
|
+ </span>
|
|
</span>
|
|
</span>
|
|
|
|
|
|
</span>
|
|
</span>
|