From befe9338150bb3b94ae4dd6a51133cacf06976df Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 22 Feb 2024 14:20:08 +0300 Subject: [PATCH] Fix advanced settings --- apps/documenteditor/main/app/controller/Main.js | 6 ++---- apps/documenteditor/main/app/view/FileMenuPanels.js | 12 ++++++++---- apps/pdfeditor/main/app/controller/Main.js | 6 ++---- apps/pdfeditor/main/app/view/FileMenuPanels.js | 12 ++++++++---- .../main/app/view/FileMenuPanels.js | 4 ++-- .../main/app/view/FileMenuPanels.js | 4 ++-- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 445639e526..700d05db10 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1714,10 +1714,8 @@ define([ } } fastCoauth = (value===null || parseInt(value) == 1); - - value = Common.localStorage.getItem((fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); - if (value == null) value = fastCoauth ? 'none' : 'last'; - Common.Utils.InternalSettings.set((fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", value); + Common.Utils.InternalSettings.set("de-settings-showchanges-fast", Common.localStorage.getItem("de-settings-showchanges-fast") || 'none'); + Common.Utils.InternalSettings.set("de-settings-showchanges-strict", Common.localStorage.getItem("de-settings-showchanges-strict") || 'last'); } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { fastCoauth = true; } else if (this.appOptions.canLiveView && !this.appOptions.isOffline) { // viewer diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 4348889f26..6d3d63f974 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -611,9 +611,11 @@ define([ dataHintDirection: 'left', dataHintOffset: 'small' }); - this.rbCoAuthModeFast.on('change', function(){ - me.chAutosave.setValue(1); - me.onChangeCoAuthMode(1); + this.rbCoAuthModeFast.on('change', function(field, newValue, eOpts){ + if (newValue) { + me.chAutosave.setValue(1); + me.onChangeCoAuthMode(1); + } }); this.rbCoAuthModeFast.$el.parent().on('click', function (){me.rbCoAuthModeFast.setValue(true);}); @@ -624,7 +626,9 @@ define([ dataHintDirection: 'left', dataHintOffset: 'small' }); - this.rbCoAuthModeStrict.on('change', _.bind(this.onChangeCoAuthMode, this,0)); + this.rbCoAuthModeStrict.on('change', function(field, newValue, eOpts){ + newValue && me.onChangeCoAuthMode(0); + }); this.rbCoAuthModeStrict.$el.parent().on('click', function (){me.rbCoAuthModeStrict.setValue(true);}); this.rbChangesBallons = new Common.UI.RadioBox({ diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index b6e1b39695..864892f4c9 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -1320,10 +1320,8 @@ define([ } } fastCoauth = (value===null || parseInt(value) == 1); - - value = Common.localStorage.getItem((fastCoauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict"); - if (value == null) value = fastCoauth ? 'none' : 'last'; - Common.Utils.InternalSettings.set((fastCoauth) ? "pdfe-settings-showchanges-fast" : "pdfe-settings-showchanges-strict", value); + Common.Utils.InternalSettings.set("pdfe-settings-showchanges-fast", Common.localStorage.getItem("pdfe-settings-showchanges-fast") || 'none'); + Common.Utils.InternalSettings.set("pdfe-settings-showchanges-strict", Common.localStorage.getItem("pdfe-settings-showchanges-strict") || 'last'); } else { fastCoauth = false; autosave = 0; diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 0ebf70e3fd..bbb229c969 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -494,9 +494,11 @@ define([ dataHintDirection: 'left', dataHintOffset: 'small' }); - this.rbCoAuthModeFast.on('change', function(){ - me.chAutosave.setValue(1); - me.onChangeCoAuthMode(1); + this.rbCoAuthModeFast.on('change', function(field, newValue, eOpts){ + if (newValue) { + me.chAutosave.setValue(1); + me.onChangeCoAuthMode(1); + } }); this.rbCoAuthModeFast.$el.parent().on('click', function (){me.rbCoAuthModeFast.setValue(true);}); @@ -507,7 +509,9 @@ define([ dataHintDirection: 'left', dataHintOffset: 'small' }); - this.rbCoAuthModeStrict.on('change', _.bind(this.onChangeCoAuthMode, this,0)); + this.rbCoAuthModeStrict.on('change', function(field, newValue, eOpts){ + newValue && me.onChangeCoAuthMode(0); + }); this.rbCoAuthModeStrict.$el.parent().on('click', function (){me.rbCoAuthModeStrict.setValue(true);}); this.rbShowChangesNone = new Common.UI.RadioBox({ diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index dce2cf57ff..f533ebdcdd 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -466,8 +466,8 @@ define([ dataHint : '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('change', function () { - me.chAutosave.setValue(1); + }).on('change', function (field, newValue, eOpts) { + newValue && me.chAutosave.setValue(1); }); this.rbCoAuthModeFast.$el.parent().on('click', function (){me.rbCoAuthModeFast.setValue(true);}); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 576572c4e2..09368b1e24 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -466,8 +466,8 @@ define([ dataHint : '2', dataHintDirection: 'left', dataHintOffset: 'small' - }).on('change', function () { - me.chAutosave.setValue(1); + }).on('change', function (field, newValue, eOpts) { + newValue && me.chAutosave.setValue(1); }); this.rbCoAuthModeFast.$el.parent().on('click', function (){me.rbCoAuthModeFast.setValue(true);});