Merge pull request #1920 from ONLYOFFICE/feature/fix-bugs
Feature/fix bugs
This commit is contained in:
commit
694d83bc64
|
@ -265,12 +265,13 @@ class ContextMenu extends ContextMenuController {
|
||||||
} else {
|
} else {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const _t = t("ContextMenu", {returnObjects: true});
|
const _t = t("ContextMenu", {returnObjects: true});
|
||||||
const { canViewComments, canCoAuthoring, canComments } = this.props;
|
const { canViewComments, canCoAuthoring, canComments, dataDoc } = this.props;
|
||||||
|
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
const inToc = api.asc_GetTableOfContentsPr(true);
|
const inToc = api.asc_GetTableOfContentsPr(true);
|
||||||
const stack = api.getSelectedElements();
|
const stack = api.getSelectedElements();
|
||||||
const canCopy = api.can_CopyCut();
|
const canCopy = api.can_CopyCut();
|
||||||
|
const docExt = dataDoc ? dataDoc.fileType : '';
|
||||||
|
|
||||||
let isText = false,
|
let isText = false,
|
||||||
isObject = false,
|
isObject = false,
|
||||||
|
@ -306,14 +307,14 @@ class ContextMenu extends ContextMenuController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isDisconnected) {
|
if (!isDisconnected) {
|
||||||
if (canFillForms && canCopy && !locked && !isViewer) {
|
if (canFillForms && canCopy && !locked && (!isViewer || docExt === 'oform')) {
|
||||||
itemsIcon.push({
|
itemsIcon.push({
|
||||||
event: 'cut',
|
event: 'cut',
|
||||||
icon: 'icon-cut'
|
icon: 'icon-cut'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canFillForms && canCopy && !locked && !isViewer) {
|
if (canFillForms && canCopy && !locked && (!isViewer || docExt === 'oform')) {
|
||||||
itemsIcon.push({
|
itemsIcon.push({
|
||||||
event: 'paste',
|
event: 'paste',
|
||||||
icon: 'icon-paste'
|
icon: 'icon-paste'
|
||||||
|
|
|
@ -257,6 +257,14 @@ class MainController extends Component {
|
||||||
appSettings.changeShowTableEmptyLine(value);
|
appSettings.changeShowTableEmptyLine(value);
|
||||||
this.api.put_ShowTableEmptyLine(value);
|
this.api.put_ShowTableEmptyLine(value);
|
||||||
|
|
||||||
|
value = LocalStorage.getBool('mobile-view', true);
|
||||||
|
|
||||||
|
if(value) {
|
||||||
|
this.api.ChangeReaderMode();
|
||||||
|
} else {
|
||||||
|
appOptions.changeMobileView();
|
||||||
|
}
|
||||||
|
|
||||||
if (appOptions.isEdit && this.needToUpdateVersion) {
|
if (appOptions.isEdit && this.needToUpdateVersion) {
|
||||||
Common.Notifications.trigger('api:disconnect');
|
Common.Notifications.trigger('api:disconnect');
|
||||||
}
|
}
|
||||||
|
@ -273,7 +281,6 @@ class MainController extends Component {
|
||||||
this.api.Resize();
|
this.api.Resize();
|
||||||
this.api.zoomFitToWidth();
|
this.api.zoomFitToWidth();
|
||||||
this.api.asc_GetDefaultTableStyles && setTimeout(() => {this.api.asc_GetDefaultTableStyles()}, 1);
|
this.api.asc_GetDefaultTableStyles && setTimeout(() => {this.api.asc_GetDefaultTableStyles()}, 1);
|
||||||
this.api.ChangeReaderMode();
|
|
||||||
this.applyLicense();
|
this.applyLicense();
|
||||||
|
|
||||||
Common.Notifications.trigger('document:ready');
|
Common.Notifications.trigger('document:ready');
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { f7 } from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ToolbarView from "../view/Toolbar";
|
import ToolbarView from "../view/Toolbar";
|
||||||
import {storeAppOptions} from "../store/appOptions";
|
import {storeAppOptions} from "../store/appOptions";
|
||||||
|
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
|
||||||
|
|
||||||
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
|
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
|
@ -145,7 +146,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||||
|
|
||||||
const changeMobileView = () => {
|
const changeMobileView = () => {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
const isMobileView = appOptions.isMobileView;
|
||||||
|
|
||||||
|
LocalStorage.setBool('mobile-view', !isMobileView);
|
||||||
appOptions.changeMobileView();
|
appOptions.changeMobileView();
|
||||||
api.ChangeReaderMode();
|
api.ChangeReaderMode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { observer, inject } from "mobx-react";
|
||||||
import {Device} from '../../../../../common/mobile/utils/device';
|
import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
|
|
||||||
import SettingsView from "../../view/settings/Settings";
|
import SettingsView from "../../view/settings/Settings";
|
||||||
|
import {LocalStorage} from "../../../../../common/mobile/utils/LocalStorage";
|
||||||
|
|
||||||
const Settings = props => {
|
const Settings = props => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -84,7 +85,9 @@ const Settings = props => {
|
||||||
const onChangeMobileView = async () => {
|
const onChangeMobileView = async () => {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
const appOptions = props.storeAppOptions;
|
const appOptions = props.storeAppOptions;
|
||||||
|
const isMobileView = appOptions.isMobileView;
|
||||||
|
|
||||||
|
await LocalStorage.setBool('mobile-view', !isMobileView);
|
||||||
await appOptions.changeMobileView();
|
await appOptions.changeMobileView();
|
||||||
await api.ChangeReaderMode();
|
await api.ChangeReaderMode();
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ const EditTableContents = props => {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={t('Edit.textStyle')} link="/edit-style-table-contents/" after={activeStyle.displayValue} routeProps={{
|
<ListItem title={t('Edit.textStyle')} link="/edit-style-table-contents/" after={activeStyle ? activeStyle.displayValue : ''} routeProps={{
|
||||||
onStyle: props.onStyle,
|
onStyle: props.onStyle,
|
||||||
arrStyles,
|
arrStyles,
|
||||||
setStyleValue,
|
setStyleValue,
|
||||||
|
|
Loading…
Reference in a new issue