diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f841a5cf7..1d11ef161 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -473,7 +473,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1548,8 +1548,8 @@ define([ Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this)); // change = true by default in editor, change = false by default in viewer - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || - !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && this.editorConfig.coEditing.change===true) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 69237409d..fc939b9bc 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -430,7 +430,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1195,8 +1195,8 @@ define([ this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); // change = true by default in editor, change = false by default in viewer - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || - !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && this.editorConfig.coEditing.change===true) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index e38e48a33..bbc3c28db 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -504,7 +504,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1284,8 +1284,8 @@ define([ // change = true by default in editor, change = false by default in viewer this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring && - !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || - !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; + !(this.editorConfig.coEditing && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && this.editorConfig.coEditing.change===true) ; if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) { this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);