|
@@ -140,22 +140,22 @@ class MainSuit extends Component{
|
|
const {getSearchLocation} = this.props;
|
|
const {getSearchLocation} = this.props;
|
|
let leftL=0; //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
|
|
let leftL=0; //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
|
|
let num = this.props.datas.length == 0?0:60
|
|
let num = this.props.datas.length == 0?0:60
|
|
- // if(isIE()){
|
|
|
|
- // leftL = getPageCoordinate(e).boxLeft
|
|
|
|
- // }else{
|
|
|
|
- // const ele = document.activeElement;
|
|
|
|
- // leftL = ele.offsetLeft+num
|
|
|
|
- // }
|
|
|
|
- // getSearchLocation(getPageCoordinate(e).boxTop,leftL)
|
|
|
|
- // this.setState({
|
|
|
|
- // tmpScroll: $("#addScrollEvent")[0].scrollTop,
|
|
|
|
- // tmpTop:getPageCoordinate(e).boxTop
|
|
|
|
- // });
|
|
|
|
- // windowEventHandler('scroll',()=>{ //弹窗跟随滚动条滚动或者关闭弹窗
|
|
|
|
- // let scrollYs = $("#addScrollEvent")[0].scrollTop;
|
|
|
|
- // let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
|
|
|
|
- // getSearchLocation(boxTop,this.state.boxLeft)
|
|
|
|
- // },$("#addScrollEvent")[0])
|
|
|
|
|
|
+ if(isIE()){
|
|
|
|
+ leftL = getPageCoordinate(e).boxLeft
|
|
|
|
+ }else{
|
|
|
|
+ const ele = document.activeElement;
|
|
|
|
+ leftL = ele.offsetLeft+num
|
|
|
|
+ }
|
|
|
|
+ getSearchLocation(getPageCoordinate(e).boxTop,leftL)
|
|
|
|
+ this.setState({
|
|
|
|
+ tmpScroll: $("#addScrollEvent")[0].scrollTop,
|
|
|
|
+ tmpTop:getPageCoordinate(e).boxTop
|
|
|
|
+ });
|
|
|
|
+ windowEventHandler('scroll',()=>{ //弹窗跟随滚动条滚动或者关闭弹窗
|
|
|
|
+ let scrollYs = $("#addScrollEvent")[0].scrollTop;
|
|
|
|
+ let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
|
|
|
|
+ getSearchLocation(boxTop,this.state.boxLeft)
|
|
|
|
+ },$("#addScrollEvent")[0])
|
|
}
|
|
}
|
|
|
|
|
|
handleChange(e){
|
|
handleChange(e){
|