Browse Source

fix: 解决容器id不是luckysheet时,点击工具栏中 “更多” 按钮,出现的偏移位置出错的问题

master
菜猫子neko 4 years ago
parent
commit
022714f79a
  1. 3
      src/controllers/resize.js

3
src/controllers/resize.js

@ -167,7 +167,8 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) {
//When resize, change the width of the more button container in real time //When resize, change the width of the more button container in real time
$$('#luckysheet-icon-morebtn-div').style.left = '';//reset $$('#luckysheet-icon-morebtn-div').style.left = '';//reset
const containerLeft = $$('#luckysheet').getBoundingClientRect ? $$('#luckysheet').getBoundingClientRect().left : 0; // *这里计算containerLeft的作用是:获得容器左侧的margin值,以让点击出现的“更多按钮”栏位置不会出错。
const containerLeft = $$(`#${Store.container}`).getBoundingClientRect ? $$(`#${Store.container}`).getBoundingClientRect().left : 0;
const morebtnLeft = $$('#luckysheet-icon-morebtn-div').getBoundingClientRect().left;//get real left info const morebtnLeft = $$('#luckysheet-icon-morebtn-div').getBoundingClientRect().left;//get real left info
if(morebtnLeft < containerLeft){ if(morebtnLeft < containerLeft){

Loading…
Cancel
Save