From 28322d75f832e79a4baacfb67477b5939330b7de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 11 Jan 2022 22:59:57 +0300 Subject: [PATCH] Use customization.layout section for hide statusBar, toolbar (instead of customizaton.statusBar, customizaton.toolbar parameters) --- apps/api/documents/api.js | 8 ++++---- apps/documenteditor/main/app/controller/Main.js | 4 ++++ apps/documenteditor/main/app/controller/Viewport.js | 6 +++--- apps/documenteditor/main/app/template/Viewport.template | 4 ++-- apps/presentationeditor/main/app/controller/Main.js | 4 ++++ apps/presentationeditor/main/app/controller/Viewport.js | 6 +++--- .../main/app/template/Viewport.template | 4 ++-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/Viewport.js | 6 ++++-- .../spreadsheeteditor/main/app/template/Viewport.template | 4 ++-- 10 files changed, 32 insertions(+), 18 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 19f32f884..4eaf9b218 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -165,7 +165,7 @@ navigation: false/true // navigation button in de } / false / true, // view tab save: false/true // save button on toolbar in - }, + } / false / true, // use instead of customization.toolbar, header: { users: false/true // users list button save: false/true // save button @@ -179,7 +179,7 @@ textLang: false/true // text language button in de/pe docLang: false/true // document language button in de/pe actionStatus: false/true // status of operation - } + } / false / true, // use instead of customization.statusBar }, features: { // disable feature spellcheck: { @@ -194,8 +194,8 @@ leftMenu: true, // must be deprecated. use layout.leftMenu instead rightMenu: true, // must be deprecated. use layout.rightMenu instead hideRightMenu: false, // hide or show right panel on first loading - toolbar: true, - statusBar: true, + toolbar: true, // must be deprecated. use layout.toolbar instead + statusBar: true, // must be deprecated. use layout.statusBar instead autosave: true, forcesave: false, commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index fac43e2b1..38b419858 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2084,6 +2084,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index a375cc8ed..469e35668 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -171,7 +171,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -205,7 +205,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); toolbar = me.getApplication().getController('Toolbar').getView(); toolbar.btnCollabChanges = me.header.btnSave; @@ -246,7 +246,7 @@ define([ value: 'statusbar' }); - if ( config.canBrandingExt && config.customization && config.customization.statusBar === false ) + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) me.header.mnuitemHideStatusBar.hide(); me.header.mnuitemHideRulers = new Common.UI.MenuItem({ diff --git a/apps/documenteditor/main/app/template/Viewport.template b/apps/documenteditor/main/app/template/Viewport.template index c407ba7a5..d18c97b98 100644 --- a/apps/documenteditor/main/app/template/Viewport.template +++ b/apps/documenteditor/main/app/template/Viewport.template @@ -4,7 +4,7 @@
-
+
@@ -14,6 +14,6 @@
-
+
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index aa78778e4..72428694d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1720,6 +1720,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 4cecb100f..b79d21b1d 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -181,7 +181,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -206,7 +206,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); toolbar = me.getApplication().getController('Toolbar').getView('Toolbar'); toolbar.btnCollabChanges = me.header.btnSave; @@ -255,7 +255,7 @@ define([ value: 'statusbar' }); - if ( config.canBrandingExt && config.customization && config.customization.statusBar === false ) + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) me.header.mnuitemHideStatusBar.hide(); me.header.mnuitemHideRulers = new Common.UI.MenuItem({ diff --git a/apps/presentationeditor/main/app/template/Viewport.template b/apps/presentationeditor/main/app/template/Viewport.template index 8f80302b9..14dff927e 100644 --- a/apps/presentationeditor/main/app/template/Viewport.template +++ b/apps/presentationeditor/main/app/template/Viewport.template @@ -5,7 +5,7 @@
-
+
@@ -15,6 +15,6 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 48e5cf103..15e20d05f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2090,6 +2090,10 @@ define([ console.log("Obsolete: The 'leftMenu' parameter of the 'customization' section is deprecated. Please use 'leftMenu' parameter in the 'customization.layout' section instead."); if (this.appOptions.customization.rightMenu!==undefined) console.log("Obsolete: The 'rightMenu' parameter of the 'customization' section is deprecated. Please use 'rightMenu' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.statusBar!==undefined) + console.log("Obsolete: The 'statusBar' parameter of the 'customization' section is deprecated. Please use 'statusBar' parameter in the 'customization.layout' section instead."); + if (this.appOptions.customization.toolbar!==undefined) + console.log("Obsolete: The 'toolbar' parameter of the 'customization' section is deprecated. Please use 'toolbar' parameter in the 'customization.layout' section instead."); } promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 551281f55..171cbf229 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -152,7 +152,7 @@ define([ var _intvars = Common.Utils.InternalSettings; var $filemenu = $('.toolbar-fullview-panel'); - $filemenu.css('top', _intvars.get('toolbar-height-tabs')); + $filemenu.css('top', Common.UI.LayoutManager.isElementVisible('toolbar') ? _intvars.get('toolbar-height-tabs') : 0); me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); @@ -180,7 +180,7 @@ define([ _intvars.set('toolbar-height-compact', _tabs_new_height); _intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls')); - $filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height')); + $filemenu.css('top', (Common.UI.LayoutManager.isElementVisible('toolbar') ? _tabs_new_height : 0) + _intvars.get('document-title-height')); } if ( config.customization ) { @@ -225,6 +225,8 @@ define([ checkable: true, value: 'statusbar' }); + if ( config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) + me.header.mnuitemCompactStatusBar.hide(); me.header.mnuitemHideFormulaBar = new Common.UI.MenuItem({ caption : me.textHideFBar, diff --git a/apps/spreadsheeteditor/main/app/template/Viewport.template b/apps/spreadsheeteditor/main/app/template/Viewport.template index 3104c7962..9f4c6db7a 100644 --- a/apps/spreadsheeteditor/main/app/template/Viewport.template +++ b/apps/spreadsheeteditor/main/app/template/Viewport.template @@ -4,7 +4,7 @@
-
+
@@ -19,6 +19,6 @@
-
+