From 71b82e742ccd30ddb06721efb242cf8ed7562f0b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 16 Jun 2017 10:25:06 +0300 Subject: [PATCH] Commenting in view mode: set autosave to true. --- apps/documenteditor/main/app/controller/LeftMenu.js | 10 ++++++---- apps/documenteditor/main/app/controller/Main.js | 1 + .../main/app/controller/LeftMenu.js | 12 +++++++----- apps/presentationeditor/main/app/controller/Main.js | 4 +++- .../main/app/controller/LeftMenu.js | 6 ++++-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 +++- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index a425b894c..c25f6e993 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -313,11 +313,13 @@ define([ case '0': this.api.SetFontRenderingMode(3); break; } - value = Common.localStorage.getItem("de-settings-autosave"); - this.api.asc_setAutoSaveGap(parseInt(value)); + if (this.mode.isEdit) { + value = Common.localStorage.getItem("de-settings-autosave"); + this.api.asc_setAutoSaveGap(parseInt(value)); - value = Common.localStorage.getItem("de-settings-spellcheck"); - this.api.asc_setSpellCheck(value===null || parseInt(value) == 1); + value = Common.localStorage.getItem("de-settings-spellcheck"); + this.api.asc_setSpellCheck(value===null || parseInt(value) == 1); + } value = Common.localStorage.getItem("de-settings-showsnaplines"); this.api.put_ShowSnapLines(value===null || parseInt(value) == 1); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index e6e1ba9ca..e6d852068 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -812,6 +812,7 @@ define([ } else if (!me.appOptions.isEdit && me.appOptions.canComments) { me._state.fastCoauth = true; me.api.asc_SetFastCollaborative(me._state.fastCoauth); + me.api.asc_setAutoSaveGap(1); } else { me._state.fastCoauth = false; me.api.asc_SetFastCollaborative(me._state.fastCoauth); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index d749de2dc..c91eed513 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -232,9 +232,6 @@ define([ var value = Common.localStorage.getItem("pe-settings-inputmode"); this.api.SetTextBoxInputMode(parseInt(value) == 1); - value = Common.localStorage.getItem("pe-settings-spellcheck"); - this.api.asc_setSpellCheck(parseInt(value) == 1); - /** coauthoring begin **/ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { value = Common.localStorage.getItem("pe-settings-coauthmode"); @@ -242,8 +239,13 @@ define([ } /** coauthoring end **/ - value = Common.localStorage.getItem("pe-settings-autosave"); - this.api.asc_setAutoSaveGap(parseInt(value)); + if (this.mode.isEdit) { + value = Common.localStorage.getItem("pe-settings-autosave"); + this.api.asc_setAutoSaveGap(parseInt(value)); + + value = Common.localStorage.getItem("pe-settings-spellcheck"); + this.api.asc_setSpellCheck(parseInt(value) == 1); + } value = Common.localStorage.getItem("pe-settings-showsnaplines"); this.api.put_ShowSnapLines(value===null || parseInt(value) == 1); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index ffa16bf9b..3618f9eb9 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -587,8 +587,10 @@ define([ value = 0; // use customization.autosave only when pe-settings-coauthmode and pe-settings-autosave are null } me._state.fastCoauth = (value===null || parseInt(value) == 1); - } else + } else { me._state.fastCoauth = (!me.appOptions.isEdit && me.appOptions.canComments); + me._state.fastCoauth && me.api.asc_setAutoSaveGap(1); + } me.api.asc_SetFastCollaborative(me._state.fastCoauth); /** coauthoring end **/ diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 1fc36d2ea..06c810251 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -266,8 +266,10 @@ define([ } /** coauthoring end **/ - value = Common.localStorage.getItem("sse-settings-autosave"); - this.api.asc_setAutoSaveGap(parseInt(value)); + if (this.mode.isEdit) { + value = Common.localStorage.getItem("sse-settings-autosave"); + this.api.asc_setAutoSaveGap(parseInt(value)); + } value = Common.localStorage.getItem("sse-settings-func-locale"); if (value) value = SSE.Views.FormulaLang.get(value); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 8f0e183fe..ea23d5fde 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -556,8 +556,10 @@ define([ value = 0; // use customization.autosave only when sse-settings-coauthmode and sse-settings-autosave are null } this._state.fastCoauth = (value===null || parseInt(value) == 1); - } else + } else { this._state.fastCoauth = (!this.appOptions.isEdit && this.appOptions.canComments); + this._state.fastCoauth && this.api.asc_setAutoSaveGap(1); + } this.api.asc_SetFastCollaborative(this._state.fastCoauth); /** coauthoring end **/