From 1456990fa9819473b3c4e1de03276a9b0a68f800 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 9 Feb 2021 15:24:35 +0300 Subject: [PATCH] [SSE mobile] Added Cell Settings --- .../mobile/src/controller/Main.jsx | 4 +-- .../mobile/src/store/cellSettings.js | 5 ++- .../mobile/src/view/edit/EditCell.jsx | 32 ++++--------------- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 50cf44d52..18df8fa53 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -209,7 +209,7 @@ class MainController extends Component { const styleSize = storeCellSettings.styleSize; this.api.asc_registerCallback('asc_onSelectionChanged', cellInfo => { - console.log(cellInfo); + // console.log(cellInfo); storeFocusObjects.resetCellInfo(cellInfo); storeCellSettings.initCellSettings(cellInfo); let selectedObjects = Common.EditorApi.get().asc_getGraphicObjectProps(); @@ -227,7 +227,7 @@ class MainController extends Component { }); this.api.asc_registerCallback('asc_onEditorSelectionChanged', fontObj => { - console.log(fontObj) + // console.log(fontObj) storeCellSettings.initFontInfo(fontObj); }); diff --git a/apps/spreadsheeteditor/mobile/src/store/cellSettings.js b/apps/spreadsheeteditor/mobile/src/store/cellSettings.js index ac880feb5..924699fee 100644 --- a/apps/spreadsheeteditor/mobile/src/store/cellSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/cellSettings.js @@ -39,9 +39,9 @@ export class storeCellSettings { this.initFontSettings(xfs); let color = xfs.asc_getFillColor(); - console.log(color); + // console.log(color); - let clr = this.resetColor(color); + let clr = color.get_auto() ? 'transparent' : this.resetColor(color); this.fillColor = clr; this.styleName = cellInfo.asc_getStyleName(); @@ -150,7 +150,6 @@ export class storeCellSettings { if(color) { if (color.get_auto()) { - // return clr; clr = 'auto' } else { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx index b6aa3093f..ad0e74b9a 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx @@ -14,7 +14,7 @@ const EditCell = props => { const cellStyles = storeCellSettings.cellStyles; const styleName = storeCellSettings.styleName; - console.log(storeCellSettings); + // console.log(storeCellSettings); const fontInfo = storeCellSettings.fontInfo; const fontName = fontInfo.name || _t.textFonts; @@ -22,7 +22,8 @@ const EditCell = props => { const fontColor = storeCellSettings.fontColor; const displaySize = typeof fontSize === 'undefined' ? _t.textAuto : fontSize + ' ' + _t.textPt; const fillColor = storeCellSettings.fillColor; - console.log(fillColor); + + // console.log(fillColor); const isBold = storeCellSettings.isBold; const isItalic = storeCellSettings.isItalic; @@ -32,7 +33,7 @@ const EditCell = props => { : ; - const fillColorPreview = fillColor !== 'auto' ? + const fillColorPreview = fillColor !== 'transparent' ? : ; @@ -186,17 +187,11 @@ const PageFontsCell = props => { const PageTextColorCell = props => { const { t } = useTranslation(); const _t = t("View.Edit", { returnObjects: true }); - // const storeFocusObjects = props.storeFocusObjects; - // const slideObject = storeFocusObjects.slideObject; const storePalette = props.storePalette; const storeCellSettings = props.storeCellSettings; const customColors = storePalette.customColors; - let fontColor = storeCellSettings.fontColor; + const fontColor = storeCellSettings.fontColor; - if(typeof fontColor === 'object') { - fontColor = storeCellSettings.fontColor.color; - } - const changeColor = (color, effectId, effectValue) => { if (color !== 'empty') { if (effectId !== undefined ) { @@ -233,18 +228,10 @@ const PageTextColorCell = props => { const PageFillColorCell = props => { const { t } = useTranslation(); const _t = t("View.Edit", { returnObjects: true }); - // const storeFocusObjects = props.storeFocusObjects; - // const slideObject = storeFocusObjects.slideObject; const storePalette = props.storePalette; const storeCellSettings = props.storeCellSettings; const customColors = storePalette.customColors; - let fillColor = storeCellSettings.fillColor; - - if(typeof fillColor === 'object') { - fillColor = storeCellSettings.fillColor.color; - } - - console.log(fillColor); + const fillColor = storeCellSettings.fillColor; const changeColor = (color, effectId, effectValue) => { if (color !== 'empty') { @@ -569,14 +556,10 @@ const PageBorderColorCell = props => { const storePalette = props.storePalette; const storeCellSettings = props.storeCellSettings; const borderInfo = storeCellSettings.borderInfo; - let borderColor = borderInfo.color; + const borderColor = borderInfo.color; const borderStyle = storeCellSettings.borderStyle; const customColors = storePalette.customColors; - if(typeof borderColor === "object") { - borderColor = borderInfo.color.color; - } - const changeColor = (color, effectId, effectValue) => { if (color !== 'empty') { if (effectId !== undefined ) { @@ -645,7 +628,6 @@ const PageBorderSizeCell = props => { const storeCellSettings = props.storeCellSettings; const borderInfo = storeCellSettings.borderInfo; const borderStyle = storeCellSettings.borderStyle; - // const borderSizes = storeCellSettings.borderSizes; const borderSizes = { 7: `${_t.textThin}`,