Browse Source
Merge pull request #846 from nekobc1998923/fix-resize-moreButton
fix: 解决容器id不是luckysheet时,点击工具栏中 “更多” 按钮,出现的偏移位置出错的问题
master
Dushusir
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
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
|
|
|
|
$$('#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
|
|
|
|
|
|
|
|
if(morebtnLeft < containerLeft){ |
|
|
|