From 2bcb91c15ca0e2c65da8e303c7fcb791d33f8df6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Nov 2022 21:53:27 +0300 Subject: [PATCH] Fix Bug 59959 --- apps/documenteditor/main/app/controller/Viewport.js | 5 ++--- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/main/app/controller/Viewport.js | 5 ++--- apps/presentationeditor/main/app/view/FileMenuPanels.js | 2 +- apps/spreadsheeteditor/main/app/controller/Viewport.js | 5 ++--- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 5 +++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index aa640e891..8aec4f4ae 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -81,8 +81,7 @@ define([ if (!config.isEdit || config.customization && !!config.customization.compactHeader) toolbar.setExtra('left', me.header.getPanel('left', config)); - var value = Common.localStorage.getItem("de-settings-quick-print-button"); - value = (value===null) ? 1 : parseInt(value); + var value = Common.localStorage.getBool("de-settings-quick-print-button", true); Common.Utils.InternalSettings.set("de-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) me.header.btnPrintQuick[value ? 'show' : 'hide'](); @@ -265,7 +264,7 @@ define([ }, applySettings: function () { - var value = parseInt(Common.localStorage.getItem("de-settings-quick-print-button")); + var value = Common.localStorage.getBool("de-settings-quick-print-button", true); Common.Utils.InternalSettings.set("de-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 03336d599..1161417bc 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -922,7 +922,7 @@ define([ } Common.localStorage.setItem("de-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); - Common.localStorage.setItem("de-settings-quick-print-button", this.chQuickPrint.isChecked() ? 1 : 0); + Common.localStorage.setBool("de-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 46e87a5e2..a791ba375 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -81,8 +81,7 @@ define([ toolbar.setExtra('right', me.header.getPanel('right', config)); if (!config.isEdit || config.customization && !!config.customization.compactHeader) toolbar.setExtra('left', me.header.getPanel('left', config)); - var value = Common.localStorage.getItem("pe-settings-quick-print-button"); - value = (value===null) ? 1 : parseInt(value); + var value = Common.localStorage.getBool("pe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pe-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) me.header.btnPrintQuick[value ? 'show' : 'hide'](); @@ -321,7 +320,7 @@ define([ }, applySettings: function () { - var value = parseInt(Common.localStorage.getItem("pe-settings-quick-print-button")); + var value = Common.localStorage.getBool("pe-settings-quick-print-button", true); Common.Utils.InternalSettings.set("pe-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 962c3ea16..818936a6a 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -720,7 +720,7 @@ define([ Common.Utils.InternalSettings.set("pe-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); - Common.localStorage.setItem("pe-settings-quick-print-button", this.chQuickPrint.isChecked() ? 1 : 0); + Common.localStorage.setBool("pe-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 9f48df44d..6c9f2e7e5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -90,8 +90,7 @@ define([ if ( me.appConfig && me.appConfig.isEdit && !(config.customization && config.customization.compactHeader) && toolbar.btnCollabChanges ) toolbar.btnCollabChanges = me.header.btnSave; - var value = Common.localStorage.getItem("sse-settings-quick-print-button"); - value = (value===null) ? 1 : parseInt(value); + var value = Common.localStorage.getBool("sse-settings-quick-print-button", true); Common.Utils.InternalSettings.set("sse-settings-quick-print-button", value); if (me.header && me.header.btnPrintQuick) me.header.btnPrintQuick[value ? 'show' : 'hide'](); @@ -294,7 +293,7 @@ define([ }, applySettings: function () { - var value = parseInt(Common.localStorage.getItem("sse-settings-quick-print-button")); + var value = Common.localStorage.getBool("sse-settings-quick-print-button", true); Common.Utils.InternalSettings.set("sse-settings-quick-print-button", value); if (this.header && this.header.btnPrintQuick) this.header.btnPrintQuick[value ? 'show' : 'hide'](); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 0a42ae9bf..78e1000b4 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -996,7 +996,7 @@ define([ Common.Utils.InternalSettings.set("sse-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("sse-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); - Common.localStorage.setItem("sse-settings-quick-print-button", this.chQuickPrint.isChecked() ? 1 : 0); + Common.localStorage.setBool("sse-settings-quick-print-button", this.chQuickPrint.isChecked()); Common.localStorage.save(); if (this.menu) { @@ -2736,7 +2736,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ applySettings: function() { if (this.menu) { - this.menu.fireEvent('settings:apply', [this.menu]); + this.menu.hide(); + // this.menu.fireEvent('settings:apply', [this.menu]); } },