[SSE mobile] Correct tabs is Statusbar
This commit is contained in:
parent
25213e6313
commit
722bc4b014
|
@ -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', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue