From d18478c0e11cdce994d585be216b9ad95836f073 Mon Sep 17 00:00:00 2001 From: Dushusir <1414556676@qq.com> Date: Fri, 9 Oct 2020 22:02:55 +0800 Subject: [PATCH] fix(toolbar): menu button style protection button --- src/controllers/resize.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/resize.js b/src/controllers/resize.js index 8054a68..d390ac5 100644 --- a/src/controllers/resize.js +++ b/src/controllers/resize.js @@ -143,7 +143,7 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) { // #luckysheet-icon-morebtn button width plus right is 83px if(toobarWidths[index] < gridW - 90){ moreButtonIndex = index; - if(moreButtonIndex !== 33){ + if(moreButtonIndex < toobarWidths.length - 1){ ismore = true; } @@ -290,6 +290,8 @@ export function changeSheetContainerSize(gridW, gridH){ /** * 统计工具栏各个按钮宽度值,用于计算哪些需要放到 更多按钮里 + * + * 注意:每增加一个工具栏按钮,都要在toobarWidths和toobarElements这两个数组里加上按钮的统计数据 */ export function menuToolBarWidth() { const toobarObject = Store.toobarObject; @@ -326,9 +328,9 @@ export function menuToolBarWidth() { $('#luckysheet-dataVerification-btn-title').offset().left, $('#luckysheet-splitColumn-btn-title').offset().left, $('#luckysheet-chart-btn-screenshot').offset().left, - $('#luckysheet-icon-protection').offset().left, $('#luckysheet-icon-seachmore').offset().left, - $('#luckysheet-icon-seachmore').offset().left + $('#luckysheet-icon-seachmore').outerWidth() + 5, + $('#luckysheet-icon-protection').offset().left, + $('#luckysheet-icon-protection').offset().left + $('#luckysheet-icon-protection').outerWidth() + 5, ]; toobarObject.toobarElements = [ '#luckysheet-icon-undo',