[DE PE mobile] Changes for private branch

This commit is contained in:
JuliaSvinareva 2021-04-16 19:03:30 +03:00
parent fe1a9e16d3
commit 45a9058da4
6 changed files with 23 additions and 39 deletions

View file

@ -65,7 +65,7 @@ class ContextMenu extends ContextMenuController {
onMenuItemClick(action) {
super.onMenuItemClick(action);
if ( EditorUIController.ContextMenu.handleMenuItemClick(this, action) )
if ( EditorUIController.ContextMenu && EditorUIController.ContextMenu.handleMenuItemClick(this, action) )
return;
const api = Common.EditorApi.get();
@ -205,7 +205,7 @@ class ContextMenu extends ContextMenuController {
if ( !Common.EditorApi ) return [];
const { isEdit } = this.props;
if (isEdit) {
if (isEdit && EditorUIController.ContextMenu) {
return EditorUIController.ContextMenu.mapMenuItems(this);
} else {
const { t } = this.props;

View file

@ -9,8 +9,6 @@ import {InitReviewController as ReviewController} from '../../../../common/mobil
import { onAdvancedOptions } from './settings/Download.jsx';
import {
CommentsController,
AddCommentController,
EditCommentController,
ViewCommentsController
} from "../../../../common/mobile/lib/controller/collaboration/Comments";
import About from '../../../../common/mobile/lib/view/About';
@ -488,9 +486,7 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onDocumentName', this.onDocumentName.bind(this));
this.api.asc_registerCallback('asc_onPrintUrl', this.onPrintUrl.bind(this));
this.api.asc_registerCallback('asc_onSendThemeColors', (colors, standart_colors) => {
Common.Utils.ThemeColor.setColors(colors, standart_colors);
});
EditorUIController.initThemeColors && EditorUIController.initThemeColors();
this.api.asc_registerCallback('asc_onDownloadUrl', this.onDownloadUrl.bind(this));
@ -504,8 +500,8 @@ class MainController extends Component {
//text settings
const storeTextSettings = this.props.storeTextSettings;
EditorUIController.initFonts(storeTextSettings);
EditorUIController.initFocusObjects(this.props.storeFocusObjects);
EditorUIController.initFonts && EditorUIController.initFonts(storeTextSettings);
EditorUIController.initFocusObjects && EditorUIController.initFocusObjects(this.props.storeFocusObjects);
this.api.asc_registerCallback('asc_onVerticalAlign', (typeBaseline) => {
storeTextSettings.resetTypeBaseline(typeBaseline);
@ -543,19 +539,13 @@ class MainController extends Component {
});
//paragraph settings
EditorUIController.initEditorStyles(this.props.storeParagraphSettings);
EditorUIController.initEditorStyles && EditorUIController.initEditorStyles(this.props.storeParagraphSettings);
//table settings
EditorUIController.initTableTemplates(this.props.storeTableSettings);
EditorUIController.initTableTemplates && EditorUIController.initTableTemplates(this.props.storeTableSettings);
//chart settings
const storeChartSettings = this.props.storeChartSettings;
const storeFocusObjects = this.props.storeFocusObjects;
this.api.asc_registerCallback('asc_onUpdateChartStyles', () => {
if (storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties()) {
storeChartSettings.updateChartStyles(this.api.asc_getChartPreviews(storeFocusObjects.chartObject.get_ChartProperties().getType()));
}
});
EditorUIController.updateChartStyles && EditorUIController.updateChartStyles(this.props.storeChartSettings, this.props.storeFocusObjects);
// Document Info
@ -782,8 +772,7 @@ class MainController extends Component {
<CollaborationController />
<ReviewController />
<CommentsController />
<AddCommentController />
<EditCommentController />
{EditorUIController.getEditCommentControllers && EditorUIController.getEditCommentControllers()}
<ViewCommentsController />
</Fragment>
)

View file

@ -9,7 +9,7 @@ const ToolbarView = props => {
<Fragment>
<NavLeft>
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
{props.isEdit && EditorUIController.getUndoRedo({
{props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
disabledUndo: !props.isCanUndo,
disabledRedo: !props.isCanRedo,
onUndoClick: props.onUndo,
@ -18,7 +18,7 @@ const ToolbarView = props => {
</NavLeft>
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
<NavRight>
{props.isEdit && EditorUIController.getToolbarOptions({
{props.isEdit && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
disabled: disableEditBtn || props.disabledControls,
onEditClick: e => props.openOptions('edit'),
onAddClick: e => props.openOptions('add')

View file

@ -58,7 +58,7 @@ class ContextMenu extends ContextMenuController {
onMenuItemClick(action) {
super.onMenuItemClick(action);
if ( EditorUIController.ContextMenu.handleMenuItemClick(this, action) )
if ( EditorUIController.ContextMenu && EditorUIController.ContextMenu.handleMenuItemClick(this, action) )
return;
const api = Common.EditorApi.get();
@ -142,7 +142,7 @@ class ContextMenu extends ContextMenuController {
const { isEdit } = this.props;
if (isEdit) {
if (isEdit && EditorUIController.ContextMenu) {
return EditorUIController.ContextMenu.mapMenuItems(this);
} else {
const { t } = this.props;

View file

@ -180,6 +180,8 @@ class MainController extends Component {
this.api.asc_registerCallback('asc_onDocumentContentReady', this._onDocumentContentReady.bind(this));
this.api.asc_registerCallback('asc_onOpenDocumentProgress', this._onOpenDocumentProgress.bind(this));
EditorUIController.initThemeColors && EditorUIController.initThemeColors();
const storePresentationSettings = this.props.storePresentationSettings;
this.api.asc_registerCallback('asc_onPresentationSize', (width, height) => {
@ -190,15 +192,15 @@ class MainController extends Component {
storePresentationSettings.addSchemes(arr);
});
EditorUIController.initFocusObjects(this.props.storeFocusObjects);
EditorUIController.initFocusObjects && EditorUIController.initFocusObjects(this.props.storeFocusObjects);
EditorUIController.initEditorStyles(this.props.storeSlideSettings);
EditorUIController.initEditorStyles && EditorUIController.initEditorStyles(this.props.storeSlideSettings);
// Text settings
const storeTextSettings = this.props.storeTextSettings;
EditorUIController.initFonts(storeTextSettings);
EditorUIController.initFonts && EditorUIController.initFonts(storeTextSettings);
this.api.asc_registerCallback('asc_onVerticalAlign', (typeBaseline) => {
storeTextSettings.resetTypeBaseline(typeBaseline);
@ -257,17 +259,11 @@ class MainController extends Component {
// Table settings
EditorUIController.initTableTemplates(this.props.storeTableSettings);
EditorUIController.initTableTemplates && EditorUIController.initTableTemplates(this.props.storeTableSettings);
// Chart settings
const storeChartSettings = this.props.storeChartSettings;
this.api.asc_registerCallback('asc_onUpdateChartStyles', () => {
if (storeFocusObjects.chartObject) {
storeChartSettings.updateChartStyles(this.api.asc_getChartPreviews(storeFocusObjects.chartObject.getType()));
}
});
EditorUIController.updateChartStyles && EditorUIController.updateChartStyles(this.props.storeChartSettings, this.props.storeFocusObjects);
}
_onDocumentContentReady() {
@ -304,8 +300,7 @@ class MainController extends Component {
<Fragment>
<CollaborationController />
<CommentsController />
<AddCommentController />
<EditCommentController />
{EditorUIController.getEditCommentControllers && EditorUIController.getEditCommentControllers()}
<ViewCommentsController />
</Fragment>
)

View file

@ -8,7 +8,7 @@ const ToolbarView = props => {
<Fragment>
<NavLeft>
{props.isShowBack && <Link className={`btn-doc-back${props.disabledControls && ' disabled'}`} icon='icon-back' onClick={props.onBack}></Link>}
{props.isEdit && EditorUIController.getUndoRedo({
{props.isEdit && EditorUIController.getUndoRedo && EditorUIController.getUndoRedo({
disabledUndo: !props.isCanUndo,
disabledRedo: !props.isCanRedo,
onUndoClick: props.onUndo,
@ -18,7 +18,7 @@ const ToolbarView = props => {
{!Device.phone && <NavTitle>{props.docTitle}</NavTitle>}
<NavRight>
<Link className={(props.disabledControls || props.disabledPreview) && 'disabled'} icon='icon-play' href={false} onClick={() => {props.openOptions('preview')}}></Link>
{props.isEdit && EditorUIController.getToolbarOptions({
{props.isEdit && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
disabledAdd: props.disabledAdd || props.disabledControls,
disabledEdit: props.disabledEdit || props.disabledControls,
onEditClick: () => props.openOptions('edit'),