From 722bc4b01414bb97fccf6a8ce8a03cc6025850ed Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Mon, 29 Mar 2021 22:10:45 +0300 Subject: [PATCH] [SSE mobile] Correct tabs is Statusbar --- .../mobile/src/controller/Statusbar.jsx | 13 ++++++------- .../mobile/src/less/statusbar.less | 6 ++++-- apps/spreadsheeteditor/mobile/src/store/sheets.js | 8 -------- .../spreadsheeteditor/mobile/src/view/Statusbar.jsx | 2 +- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index b8783e196..897d5b36c 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -70,7 +70,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { const sheets_count = api.asc_getWorksheetsCount(); const active_index = api.asc_getActiveWorksheetIndex(); - let i = -1, items = [], hiddentems = []; + let i = -1, items = []; while (++i < sheets_count) { const tab = { @@ -82,13 +82,11 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { color : api.asc_getWorksheetTabColor(i) }; - (api.asc_isWorksheetHidden(i) ? hiddentems : items).push(tab); - // items.push(tab); + // (api.asc_isWorksheetHidden(i) ? hiddentems : items).push(tab); + items.push(tab); } sheets.resetSheets(items); - sheets.resetHiddenSheets(hiddentems); - updateTabsColors(); }; @@ -107,6 +105,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { }; const setTabLineColor = (tab, color) => { + console.log(tab); if (tab) { if (null !== color) { color = '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()); @@ -121,9 +120,9 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { color = '0px 4px 0 ' + color + ' inset'; } - $$('.sheet-tabs .tab').eq(tab.index).css('box-shadow', color); + $$('.sheet-tabs .tab a').eq(tab.index).css('box-shadow', color); } else { - $$('.sheet-tabs .tab').eq(tab.index).css('box-shadow', ''); + $$('.sheet-tabs .tab a').eq(tab.index).css('box-shadow', ''); } } }; diff --git a/apps/spreadsheeteditor/mobile/src/less/statusbar.less b/apps/spreadsheeteditor/mobile/src/less/statusbar.less index e2dc8269a..d0349cf0a 100644 --- a/apps/spreadsheeteditor/mobile/src/less/statusbar.less +++ b/apps/spreadsheeteditor/mobile/src/less/statusbar.less @@ -16,7 +16,7 @@ min-width: 48px; display: inline-block; - padding: 0 10px; + // padding: 0 10px; text-align: center; height: 100%; position: relative; @@ -45,9 +45,11 @@ > li { a { font-size: 12px; - padding: 0 10px 0; + padding: 0 20px 0; line-height: @statusbar-height; color: @text-normal; + height: 100%; + display: block; } &:not(.active) { diff --git a/apps/spreadsheeteditor/mobile/src/store/sheets.js b/apps/spreadsheeteditor/mobile/src/store/sheets.js index b0a592be0..bb79938d3 100644 --- a/apps/spreadsheeteditor/mobile/src/store/sheets.js +++ b/apps/spreadsheeteditor/mobile/src/store/sheets.js @@ -21,28 +21,20 @@ class Worksheet { export class storeWorksheets { sheets; - hiddensheets; constructor() { makeObservable(this, { sheets: observable, - hiddensheets: observable, resetSheets: action, - resetHiddenSheets: action, setActiveWorksheet: action }); this.sheets = []; - this.hiddensheets = []; } resetSheets(sheets) { this.sheets = Object.values(sheets) } - resetHiddenSheets(hiddensheets) { - this.hiddensheets = Object.values(hiddensheets) - } - setActiveWorksheet(i) { if ( !this.sheets[i].active ) { this.sheets.forEach(model => { diff --git a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx index d0d7fea21..088994c5f 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx @@ -14,7 +14,7 @@ const StatusbarView = inject('sheets')(observer(props => { const isAndroid = Device.android; const isPhone = Device.isPhone; const { sheets } = props; - const hiddenSheets = sheets.hiddensheets; + const hiddenSheets = sheets.hiddenWorksheets(); const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`; // const $boxTabs = $$('.sheet-tabs'); // const $statusBar = $$('.statusbar');