Merge pull request #1524 from ONLYOFFICE/feature/refactor-tab-color
Feature/refactor tab color
This commit is contained in:
commit
22a855c9e1
|
@ -71,7 +71,6 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser
|
|||
sheets.setActiveWorksheet(index);
|
||||
Common.Notifications.trigger('sheet:active', index);
|
||||
}
|
||||
onApiSheetsChanged();
|
||||
};
|
||||
|
||||
const onApiHideTabContextMenu = () => {
|
||||
|
@ -375,10 +374,11 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
|
|||
|
||||
const onSetWorkSheetColor = (color) => {
|
||||
const api = Common.EditorApi.get();
|
||||
let arrIndex = [];
|
||||
const active_index = api.asc_getActiveWorksheetIndex();
|
||||
const arrIndex = [];
|
||||
|
||||
if (api) {
|
||||
arrIndex.push(api.asc_getActiveWorksheetIndex());
|
||||
arrIndex.push(active_index);
|
||||
if (arrIndex) {
|
||||
if(color === 'transparent') {
|
||||
api.asc_setWorksheetTabColor(null, arrIndex);
|
||||
|
@ -392,6 +392,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
|
|||
}
|
||||
}
|
||||
}
|
||||
sheets.sheets[active_index].color = api.asc_getWorksheetTabColor(active_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@
|
|||
&.icon-plus {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{toolbar-icons}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>', @toolbar-icons);
|
||||
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{fill-white}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>', @fill-white);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ const PageCustomTabColor = inject("storePalette")(observer (props => {
|
|||
|
||||
const PageTabColor = inject("storePalette")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const {sheets} = props;
|
||||
const allSheets = sheets.sheets;
|
||||
const {sheets, allSheets = sheets.sheets} = props;
|
||||
const storePalette = props.storePalette;
|
||||
const customColors = storePalette.customColors;
|
||||
const activeIndex = sheets.activeWorksheet;
|
||||
|
@ -96,7 +95,7 @@ const PageTabColor = inject("storePalette")(observer(props => {
|
|||
sheets.changeTabColor('transparent');
|
||||
}
|
||||
}
|
||||
}, [allSheets])
|
||||
}, [activeIndex]);
|
||||
|
||||
const changeColor = (color, effectId, effectValue) => {
|
||||
if (color !== 'empty') {
|
||||
|
|
Loading…
Reference in a new issue