diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index 36c235beac..b8292d9706 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -505,6 +505,12 @@ } } +#edit-table-style { + .list ul ul { + padding-left: 0; + } +} + // Cell styles .cell-styles-list { diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 136679559e..54d0b7c63d 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -25,6 +25,7 @@ class ContextMenu extends ContextMenuController { this.onApiHideComment = this.onApiHideComment.bind(this); this.onApiShowChange = this.onApiShowChange.bind(this); this.getUserName = this.getUserName.bind(this); + this.ShowModal = this.ShowModal.bind(this); } static closeContextMenu() { @@ -43,9 +44,13 @@ class ContextMenu extends ContextMenuController { api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment); api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment); api.asc_unregisterCallback('asc_onShowRevisionsChange', this.onApiShowChange); + Common.Notifications.off('showSplitModal', this.ShowModal); } - + ShowModal() { + this.showSplitModal() + } + onApiShowComment(comments) { this.isComments = comments && comments.length > 0; } @@ -199,6 +204,7 @@ class ContextMenu extends ContextMenuController { api.asc_registerCallback('asc_onShowComment', this.onApiShowComment); api.asc_registerCallback('asc_onHideComment', this.onApiHideComment); api.asc_registerCallback('asc_onShowRevisionsChange', this.onApiShowChange); + Common.Notifications.on('showSplitModal', this.ShowModal); } initMenuItems() { diff --git a/apps/documenteditor/mobile/src/controller/Error.jsx b/apps/documenteditor/mobile/src/controller/Error.jsx index ff499f2515..21b8d35e4e 100644 --- a/apps/documenteditor/mobile/src/controller/Error.jsx +++ b/apps/documenteditor/mobile/src/controller/Error.jsx @@ -199,14 +199,18 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu Common.Gateway.reportWarning(id, config.msg); config.title = _t.notcriticalErrorTitle; + config.callback = (btn) => { if (id === Asc.c_oAscError.ID.Warning && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { api.asc_DownloadOrigin(); + } else if(id === Asc.c_oAscError.ID.SplitCellMaxRows || + Asc.c_oAscError.ID.SplitCellMaxCols || + Asc.c_oAscError.ID.SplitCellRowsDivider && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { + Common.Notifications.trigger('showSplitModal',true); } storeAppOptions.changeEditingRights(false); }; } - f7.dialog.create({ cssClass: 'error-dialog', title : config.title, diff --git a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx index bd7168253b..227dc6f1f6 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx @@ -507,6 +507,9 @@ const EditShape = props => { const storeShapeSettings = props.storeShapeSettings; const shapeObject = props.storeFocusObjects.shapeObject; const wrapType = storeShapeSettings.getWrapType(shapeObject); + + let disableRemove = !!props.storeFocusObjects.paragraphObject; + return ( @@ -537,7 +540,7 @@ const EditShape = props => { }}> - {props.onRemoveShape()}} className='button-red button-fill button-raised'/> + {props.onRemoveShape()}} className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} /> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx index 85f24591b1..528c3bf230 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx @@ -173,40 +173,25 @@ const PageWrap = props => { // Style -const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyleClick, storeFocusObjects}) => { +const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer(({onStyleClick,storeTableSettings,storeFocusObjects}) => { const tableObject = storeFocusObjects.tableObject; const styleId = tableObject && tableObject.get_TableStyle(); const [stateId, setId] = useState(styleId); - - const widthContainer = document.querySelector(".page-content").clientWidth; - const columns = parseInt((widthContainer - 47) / 70); // magic - const styles = []; - let row = -1; - templates.forEach((style, index) => { - if (0 == index % columns) { - styles.push([]); - row++ - } - styles[row].push(style); - }); + const styles = storeTableSettings.styles; return (
- {styles.map((row, rowIndex) => { - return ( -
- {row.map((style, index)=>{ - return( -
{onStyleClick(style.templateId); setId(style.templateId)}}> - -
- ) - })} -
- ) - })} +
) })); diff --git a/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx b/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx index 140d28d590..71210945c3 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditShape.jsx @@ -12,6 +12,8 @@ const EditShape = props => { const shapeObject = storeFocusObjects.shapeObject; const canFill = shapeObject && shapeObject.get_CanFill(); + let disableRemove = !!props.storeFocusObjects.paragraphObject; + return ( @@ -39,7 +41,7 @@ const EditShape = props => { }}> - {_t.textRemoveShape} + {_t.textRemoveShape} ) diff --git a/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx b/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx index 2237d5aa29..2377f9295b 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditTable.jsx @@ -7,45 +7,30 @@ import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile // Style -const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyleClick, storeFocusObjects}) => { +const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer(({onStyleClick,storeTableSettings,storeFocusObjects}) => { const tableObject = storeFocusObjects.tableObject; const styleId = tableObject ? tableObject.get_TableStyle() : null; const [stateId, setId] = useState(styleId); - - const widthContainer = document.querySelector(".page-content").clientWidth; - const columns = parseInt((widthContainer - 47) / 70); // magic - const styles = []; - let row = -1; - templates.forEach((style, index) => { - if (0 == index % columns) { - styles.push([]); - row++ - } - styles[row].push(style); - }); + const styles = storeTableSettings.styles; if (!tableObject && Device.phone) { $$('.sheet-modal.modal-in').length > 0 && f7.sheet.close(); return null; } - + return (
- {styles.map((row, rowIndex) => { - return ( -
- {row.map((style, index)=>{ - return( -
{onStyleClick(style.templateId); setId(style.templateId)}}> - -
- ) - })} -
- ) - })} +
) })); diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx index 9857805068..dd3eeb6e5a 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditShape.jsx @@ -12,6 +12,8 @@ const EditShape = props => { const shapeObject = storeFocusObjects.shapeObject; const canFill = shapeObject && shapeObject.get_ShapeProperties().asc_getCanFill(); + let disableRemove = storeFocusObjects.selections.indexOf('text') > -1; + return ( @@ -36,7 +38,7 @@ const EditShape = props => { }}> - {_t.textRemoveShape} + {_t.textRemoveShape} )