mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 01:13:22 +08:00
add evaluating jf initial swiper slide in diagram types (#976)
Co-authored-by: Polina <polina.hudyakova@onlyoffice.com> Co-committed-by: Polina <polina.hudyakova@onlyoffice.com>
This commit is contained in:
@ -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 (
|
||||
<Page>
|
||||
<Navbar backLink={t('Edit.textBack')} title={t('Edit.textType')} />
|
||||
@ -184,7 +192,7 @@ const PageChartType = props => {
|
||||
<div id={"edit-chart-type"} className="page-content no-padding-top dataview">
|
||||
<div className="chart-types">
|
||||
{types && types.length ? (
|
||||
<Swiper pagination={true}>
|
||||
<Swiper pagination={true} initialSlide={initialSlide}>
|
||||
{arraySlides.map((_, indexSlide) => {
|
||||
let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide);
|
||||
|
||||
|
||||
@ -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 (
|
||||
<Page>
|
||||
<Navbar backLink={t('View.Edit.textBack')} title={t('View.Edit.textType')} />
|
||||
@ -192,7 +200,7 @@ const PageChartType = props => {
|
||||
<div id={"edit-chart-type"} className="page-content no-padding-top dataview">
|
||||
<div className="chart-types">
|
||||
{types && types.length ? (
|
||||
<Swiper pagination={true}>
|
||||
<Swiper pagination={true} initialSlide={initialSlide}>
|
||||
{arraySlides.map((_, indexSlide) => {
|
||||
let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide);
|
||||
|
||||
|
||||
@ -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 (
|
||||
<Page>
|
||||
<Navbar backLink={t('View.Edit.textBack')} title={t('View.Edit.textType')} />
|
||||
<div id={"edit-chart-type"} className="page-content no-padding-top dataview">
|
||||
<div className="chart-types">
|
||||
{types && types.length ? (
|
||||
<Swiper pagination={true}>
|
||||
<Swiper pagination={true} initialSlide={initialSlide}>
|
||||
{arraySlides.map((_, indexSlide) => {
|
||||
let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user