Merge pull request #1920 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
maxkadushkin 2022-08-31 19:48:33 +03:00 committed by GitHub
commit 694d83bc64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 5 deletions

View file

@ -265,12 +265,13 @@ class ContextMenu extends ContextMenuController {
} else {
const { t } = this.props;
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 inToc = api.asc_GetTableOfContentsPr(true);
const stack = api.getSelectedElements();
const canCopy = api.can_CopyCut();
const docExt = dataDoc ? dataDoc.fileType : '';
let isText = false,
isObject = false,
@ -306,14 +307,14 @@ class ContextMenu extends ContextMenuController {
}
if (!isDisconnected) {
if (canFillForms && canCopy && !locked && !isViewer) {
if (canFillForms && canCopy && !locked && (!isViewer || docExt === 'oform')) {
itemsIcon.push({
event: 'cut',
icon: 'icon-cut'
});
}
if (canFillForms && canCopy && !locked && !isViewer) {
if (canFillForms && canCopy && !locked && (!isViewer || docExt === 'oform')) {
itemsIcon.push({
event: 'paste',
icon: 'icon-paste'

View file

@ -257,6 +257,14 @@ class MainController extends Component {
appSettings.changeShowTableEmptyLine(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) {
Common.Notifications.trigger('api:disconnect');
}
@ -273,7 +281,6 @@ class MainController extends Component {
this.api.Resize();
this.api.zoomFitToWidth();
this.api.asc_GetDefaultTableStyles && setTimeout(() => {this.api.asc_GetDefaultTableStyles()}, 1);
this.api.ChangeReaderMode();
this.applyLicense();
Common.Notifications.trigger('document:ready');

View file

@ -4,6 +4,7 @@ import { f7 } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import ToolbarView from "../view/Toolbar";
import {storeAppOptions} from "../store/appOptions";
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
const {t} = useTranslation();
@ -145,7 +146,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
const changeMobileView = () => {
const api = Common.EditorApi.get();
const isMobileView = appOptions.isMobileView;
LocalStorage.setBool('mobile-view', !isMobileView);
appOptions.changeMobileView();
api.ChangeReaderMode();
}

View file

@ -5,6 +5,7 @@ import { observer, inject } from "mobx-react";
import {Device} from '../../../../../common/mobile/utils/device';
import SettingsView from "../../view/settings/Settings";
import {LocalStorage} from "../../../../../common/mobile/utils/LocalStorage";
const Settings = props => {
useEffect(() => {
@ -84,7 +85,9 @@ const Settings = props => {
const onChangeMobileView = async () => {
const api = Common.EditorApi.get();
const appOptions = props.storeAppOptions;
const isMobileView = appOptions.isMobileView;
await LocalStorage.setBool('mobile-view', !isMobileView);
await appOptions.changeMobileView();
await api.ChangeReaderMode();

View file

@ -68,7 +68,7 @@ const EditTableContents = props => {
return (
<Fragment>
<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,
arrStyles,
setStyleValue,