[SSE mobile] Correct tabs is Statusbar

This commit is contained in:
SergeyEzhin 2021-03-29 22:10:45 +03:00
parent 25213e6313
commit 722bc4b014
4 changed files with 11 additions and 18 deletions

View file

@ -70,7 +70,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
const sheets_count = api.asc_getWorksheetsCount(); const sheets_count = api.asc_getWorksheetsCount();
const active_index = api.asc_getActiveWorksheetIndex(); const active_index = api.asc_getActiveWorksheetIndex();
let i = -1, items = [], hiddentems = []; let i = -1, items = [];
while (++i < sheets_count) { while (++i < sheets_count) {
const tab = { const tab = {
@ -82,13 +82,11 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
color : api.asc_getWorksheetTabColor(i) color : api.asc_getWorksheetTabColor(i)
}; };
(api.asc_isWorksheetHidden(i) ? hiddentems : items).push(tab); // (api.asc_isWorksheetHidden(i) ? hiddentems : items).push(tab);
// items.push(tab); items.push(tab);
} }
sheets.resetSheets(items); sheets.resetSheets(items);
sheets.resetHiddenSheets(hiddentems);
updateTabsColors(); updateTabsColors();
}; };
@ -107,6 +105,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
}; };
const setTabLineColor = (tab, color) => { const setTabLineColor = (tab, color) => {
console.log(tab);
if (tab) { if (tab) {
if (null !== color) { if (null !== color) {
color = '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()); 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'; 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 { } else {
$$('.sheet-tabs .tab').eq(tab.index).css('box-shadow', ''); $$('.sheet-tabs .tab a').eq(tab.index).css('box-shadow', '');
} }
} }
}; };

View file

@ -16,7 +16,7 @@
min-width: 48px; min-width: 48px;
display: inline-block; display: inline-block;
padding: 0 10px; // padding: 0 10px;
text-align: center; text-align: center;
height: 100%; height: 100%;
position: relative; position: relative;
@ -45,9 +45,11 @@
> li { > li {
a { a {
font-size: 12px; font-size: 12px;
padding: 0 10px 0; padding: 0 20px 0;
line-height: @statusbar-height; line-height: @statusbar-height;
color: @text-normal; color: @text-normal;
height: 100%;
display: block;
} }
&:not(.active) { &:not(.active) {

View file

@ -21,28 +21,20 @@ class Worksheet {
export class storeWorksheets { export class storeWorksheets {
sheets; sheets;
hiddensheets;
constructor() { constructor() {
makeObservable(this, { makeObservable(this, {
sheets: observable, sheets: observable,
hiddensheets: observable,
resetSheets: action, resetSheets: action,
resetHiddenSheets: action,
setActiveWorksheet: action setActiveWorksheet: action
}); });
this.sheets = []; this.sheets = [];
this.hiddensheets = [];
} }
resetSheets(sheets) { resetSheets(sheets) {
this.sheets = Object.values(sheets) this.sheets = Object.values(sheets)
} }
resetHiddenSheets(hiddensheets) {
this.hiddensheets = Object.values(hiddensheets)
}
setActiveWorksheet(i) { setActiveWorksheet(i) {
if ( !this.sheets[i].active ) { if ( !this.sheets[i].active ) {
this.sheets.forEach(model => { this.sheets.forEach(model => {

View file

@ -14,7 +14,7 @@ const StatusbarView = inject('sheets')(observer(props => {
const isAndroid = Device.android; const isAndroid = Device.android;
const isPhone = Device.isPhone; const isPhone = Device.isPhone;
const { sheets } = props; const { sheets } = props;
const hiddenSheets = sheets.hiddensheets; const hiddenSheets = sheets.hiddenWorksheets();
const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`; const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`;
// const $boxTabs = $$('.sheet-tabs'); // const $boxTabs = $$('.sheet-tabs');
// const $statusBar = $$('.statusbar'); // const $statusBar = $$('.statusbar');