diff --git a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx index 2b248c3cf8..abae98c472 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx @@ -177,6 +177,14 @@ const PageChartType = props => { const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return ( @@ -184,7 +192,7 @@ const PageChartType = props => {
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide); diff --git a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx index 9391c89f5b..e1f61bb24b 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx @@ -184,7 +184,15 @@ const PageChartType = props => { const storeFocusObjects = props.storeFocusObjects; const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); - + + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return ( @@ -192,7 +200,7 @@ const PageChartType = props => {
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide); diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx index 3ac89c82ab..cdcf6ff132 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx @@ -178,13 +178,21 @@ const PageChartType = props => { const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return (
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide);