From dfeea528acb7e0da16b94436194e2448f1861e49 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 29 Sep 2022 14:58:43 +0300 Subject: [PATCH] [PE] Fix guides --- apps/presentationeditor/main/app/controller/LeftMenu.js | 6 ++++-- apps/presentationeditor/main/app/controller/Main.js | 8 +++++++- apps/presentationeditor/main/app/controller/ViewTab.js | 3 +++ apps/presentationeditor/main/app/view/FileMenuPanels.js | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index c41b6fed9..e8fb6d79b 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -383,9 +383,11 @@ define([ value = parseInt(Common.localStorage.getItem("pe-settings-paste-button")); Common.Utils.InternalSettings.set("pe-settings-paste-button", value); this.api.asc_setVisiblePasteButton(!!value); - } - this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("pe-settings-showsnaplines")); + value = Common.localStorage.getBool("pe-settings-showsnaplines"); + Common.Utils.InternalSettings.set("pe-settings-showsnaplines", value); + this.api.asc_setShowSmartGuides(value); + } menu.hide(); }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 2879f9150..8b93333c2 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -861,7 +861,13 @@ define([ me.api.asc_setAutoSaveGap(Common.Utils.InternalSettings.get("pe-settings-autosave")); /** coauthoring end **/ - Common.Utils.InternalSettings.set("pe-settings-showsnaplines", me.api.get_ShowSnapLines()); + value = Common.localStorage.getBool("pe-settings-showsnaplines", true); + Common.Utils.InternalSettings.set("pe-settings-showsnaplines", value); + me.api.asc_setShowSmartGuides(value); + + value = Common.localStorage.getBool("pe-settings-showguides"); + Common.Utils.InternalSettings.set("pe-settings-showguides", value); + me.api.asc_setShowGuides(value); var application = me.getApplication(); var toolbarController = application.getController('Toolbar'), diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 763526f2a..af2dc56a9 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -222,6 +222,7 @@ define([ onGuidesShow: function(state) { this.api.asc_setShowGuides(state); + Common.localStorage.setBool('pe-settings-showguides', state); Common.NotificationCenter.trigger('edit:complete', this.view); }, @@ -248,6 +249,8 @@ define([ onGuidesSmartShow: function(state) { this.api.asc_setShowSmartGuides(state); + Common.localStorage.setBool('pe-settings-showsnaplines', state); + Common.Utils.InternalSettings.set("pe-settings-showsnaplines", state); Common.NotificationCenter.trigger('edit:complete', this.view); } diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 227cdb77d..5c18f20e6 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -711,7 +711,8 @@ define([ Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); - Common.Utils.InternalSettings.set("pe-settings-showsnaplines", this.chAlignGuides.isChecked()); + + Common.localStorage.setBool("pe-settings-showsnaplines", this.chAlignGuides.isChecked()); Common.localStorage.setItem("pe-macros-mode", this.cmbMacros.getValue()); Common.Utils.InternalSettings.set("pe-macros-mode", this.cmbMacros.getValue());