mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 09:47:17 +08:00
[DE PE SSE mobile] Fix Bug 66088
This commit is contained in:
@ -15,7 +15,6 @@ const routes = [
|
||||
{
|
||||
path: '/adding-page/',
|
||||
component: AddingPage,
|
||||
keepAlive: true
|
||||
},
|
||||
// Image
|
||||
{
|
||||
|
||||
@ -49,9 +49,11 @@ const AddLayoutContent = ({ tabs }) => {
|
||||
)
|
||||
};
|
||||
|
||||
const AddingPage = inject("storeFocusObjects", "storeTableSettings")(observer(props => {
|
||||
const AddingPage = inject("storeFocusObjects", "storeTableSettings", "storeApplicationSettings")(observer(props => {
|
||||
const mainContext = useContext(MainContext);
|
||||
const showPanels = mainContext.showPanels;
|
||||
const storeApplicationSettings = props.storeApplicationSettings;
|
||||
const directionMode = storeApplicationSettings.directionMode;
|
||||
const storeFocusObjects = props.storeFocusObjects;
|
||||
const storeTableSettings = props.storeTableSettings;
|
||||
const { t } = useTranslation();
|
||||
@ -65,6 +67,12 @@ const AddingPage = inject("storeFocusObjects", "storeTableSettings")(observer(pr
|
||||
f7.tab.show('#add-other', false);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if(directionMode === 'rtl') {
|
||||
tabs.reverse();
|
||||
}
|
||||
}, [directionMode])
|
||||
|
||||
let needDisable = false,
|
||||
canAddTable = true,
|
||||
canAddImage = true,
|
||||
|
||||
@ -15,7 +15,6 @@ const routes = [
|
||||
{
|
||||
path: '/adding-page/',
|
||||
component: AddingPage,
|
||||
keepAlive: true
|
||||
},
|
||||
// Image
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { Page, Navbar, NavRight, NavTitle, Link, Icon, Tabs, Tab, f7 } from 'framework7-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Device } from '../../../../../common/mobile/utils/device';
|
||||
import AddSlideController from "../../controller/add/AddSlide";
|
||||
import AddShapeController from "../../controller/add/AddShape";
|
||||
@ -39,10 +40,12 @@ const AddLayoutContent = ({ tabs }) => {
|
||||
)
|
||||
};
|
||||
|
||||
const AddingPage = () => {
|
||||
const AddingPage = inject("storeApplicationSettings")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Add', {returnObjects: true});
|
||||
const api = Common.EditorApi.get();
|
||||
const storeApplicationSettings = props.storeApplicationSettings;
|
||||
const directionMode = storeApplicationSettings.directionMode;
|
||||
const countPages = api.getCountPages();
|
||||
const mainContext = useContext(MainContext);
|
||||
const showPanels = mainContext.showPanels;
|
||||
@ -51,6 +54,12 @@ const AddingPage = () => {
|
||||
useEffect(() => {
|
||||
f7.tab.show('#add-other', false);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if(directionMode === 'rtl') {
|
||||
tabs.reverse();
|
||||
}
|
||||
}, [directionMode])
|
||||
|
||||
if (!showPanels && countPages) {
|
||||
tabs.push({
|
||||
@ -105,6 +114,6 @@ const AddingPage = () => {
|
||||
<AddLayoutContent tabs={tabs} />
|
||||
</Page>
|
||||
)
|
||||
};
|
||||
}));
|
||||
|
||||
export default AddingPage;
|
||||
@ -16,7 +16,6 @@ const routes = [
|
||||
{
|
||||
path: '/adding-page/',
|
||||
component: AddingPage,
|
||||
keepAlive: true
|
||||
},
|
||||
// Functions
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { Page, Navbar, NavTitle, NavRight, Link, Icon, Tabs, Tab, f7 } from 'framework7-react';
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AddChartController } from "../../controller/add/AddChart";
|
||||
import { AddFunctionController } from "../../controller/add/AddFunction";
|
||||
@ -43,15 +44,23 @@ const AddLayoutContent = ({ tabs }) => {
|
||||
)
|
||||
};
|
||||
|
||||
const AddingPage = () => {
|
||||
const AddingPage = inject("storeApplicationSettings")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Add', {returnObjects: true});
|
||||
const mainContext = useContext(MainContext);
|
||||
const addingContext = useContext(AddingContext);
|
||||
const storeApplicationSettings = props.storeApplicationSettings;
|
||||
const directionMode = storeApplicationSettings.directionMode;
|
||||
// const wsLock = mainContext.wsLock;
|
||||
const wsProps = mainContext.wsProps;
|
||||
const showPanels = addingContext.showPanels;
|
||||
const tabs = [];
|
||||
|
||||
useEffect(() => {
|
||||
if(directionMode === 'rtl') {
|
||||
tabs.reverse();
|
||||
}
|
||||
}, [directionMode])
|
||||
|
||||
if(!wsProps.Objects) {
|
||||
if(!showPanels) {
|
||||
@ -125,6 +134,6 @@ const AddingPage = () => {
|
||||
<AddLayoutContent tabs={tabs} />
|
||||
</Page>
|
||||
)
|
||||
};
|
||||
}));
|
||||
|
||||
export default AddingPage;
|
||||
Reference in New Issue
Block a user