diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index e28ae6dab..8fe1b7454 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -148,12 +148,8 @@ file: { close: false / true, advanced: false / true, - info: { - application: false/true - } / false / true + info: false / true } / false / true, - home: {} / false / true, - insert: {} / false / true, layout: {} / false / true, references: {} / false / true, collaboration: {} / false / true diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f3af140bf..62de93994 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1460,7 +1460,7 @@ define([ this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions, this.api); - this.appOptions.canBrandingExt && this.appOptions.customization && Common.UI.LayoutManager.init(this.appOptions.customization.layout); + this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); if (this.appOptions.canComments) Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this)); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index d7238664b..c77e6a42b 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -109,9 +109,9 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template), tabs: [ - {caption: me.textTabHome, action: 'home', extcls: 'canedit', layoutname: 'home'}, {caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false}, - {caption: me.textTabInsert, action: 'ins', extcls: 'canedit', layoutname: 'toolbar-insert'}, + {caption: me.textTabHome, action: 'home', extcls: 'canedit'}, + {caption: me.textTabInsert, action: 'ins', extcls: 'canedit'}, {caption: me.textTabLayout, action: 'layout', extcls: 'canedit', layoutname: 'toolbar-layout'}, {caption: me.textTabLinks, action: 'links', extcls: 'canedit', layoutname: 'toolbar-references'} ] @@ -1398,7 +1398,7 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template_view), tabs: [ - {caption: me.textTabFile, action: 'file', haspanel: false} + {caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel: false} ] } ); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 1e6272360..e35232310 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -54,7 +54,8 @@ define([ 'presentationeditor/main/app/collection/ShapeGroups', 'presentationeditor/main/app/collection/SlideLayouts', 'presentationeditor/main/app/collection/EquationGroups', - 'common/main/lib/component/HintManager' + 'common/main/lib/component/HintManager', + 'common/main/lib/component/LayoutManager' ], function () { 'use strict'; PE.Controllers.Main = Backbone.Controller.extend(_.extend((function() { @@ -1146,6 +1147,7 @@ define([ this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); @@ -1696,6 +1698,7 @@ define([ Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements); if (this.appOptions.canBrandingExt) { Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements); + Common.UI.LayoutManager.applyCustomization(); promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } } diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 3252c4cc0..411ff9e03 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -128,7 +128,7 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template), tabs: [ - {caption: me.textTabFile, action: 'file', extcls: 'canedit', haspanel:false}, + {caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false}, {caption: me.textTabHome, action: 'home', extcls: 'canedit'}, {caption: me.textTabInsert, action: 'ins', extcls: 'canedit'}, {caption: me.textTabTransitions, action: 'transit', extcls: 'canedit'} @@ -1073,7 +1073,7 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template_view), tabs: [ - {caption: me.textTabFile, action: 'file', haspanel:false} + {caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel:false} ] } ); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 717d5a325..b24aabea5 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -57,7 +57,8 @@ define([ 'spreadsheeteditor/main/app/collection/EquationGroups', 'spreadsheeteditor/main/app/collection/ConditionalFormatIcons', 'spreadsheeteditor/main/app/controller/FormulaDialog', - 'common/main/lib/component/HintManager' + 'common/main/lib/component/HintManager', + 'common/main/lib/component/LayoutManager' ], function () { 'use strict'; @@ -1257,6 +1258,7 @@ define([ if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) { this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); } this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline; @@ -2051,6 +2053,7 @@ define([ Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements); if (this.appOptions.canBrandingExt) { Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements); + Common.UI.LayoutManager.applyCustomization(); promise = this.getApplication().getController('Common.Controllers.Plugins').applyUICustomization(); } } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 6b9c4a6f4..ea11bd846 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3746,13 +3746,13 @@ define([ Array.prototype.push.apply(me.toolbar.lockControls, formulatab.getButtons()); if ( config.canFeaturePivot ) { - tab = {action: 'pivot', caption: me.textPivot, layoutname: 'toolbar-pivot'}; + tab = {action: 'pivot', caption: me.textPivot}; var pivottab = me.getApplication().getController('PivotTable'); pivottab.setApi(me.api).setConfig({toolbar: me}); $panel = pivottab.createToolbarPanel(); if ($panel) { me.toolbar.addTab(tab, $panel, 5); - me.toolbar.setVisible('pivot', Common.UI.LayoutManager.isElementVisible('toolbar-pivot')); + me.toolbar.setVisible('pivot', true); Array.prototype.push.apply(me.toolbar.lockControls, pivottab.getView('PivotTable').getButtons()); } } diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 97c8f6dac..366e0fbee 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -352,10 +352,10 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template), tabs: [ - { caption: me.textTabFile, action: 'file', extcls: 'canedit', haspanel:false}, + { caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false}, { caption: me.textTabHome, action: 'home', extcls: 'canedit'}, { caption: me.textTabInsert, action: 'ins', extcls: 'canedit'}, - {caption: me.textTabLayout, action: 'layout', extcls: 'canedit'}, + {caption: me.textTabLayout, action: 'layout', extcls: 'canedit', layoutname: 'toolbar-layout'}, {caption: me.textTabFormula, action: 'formula', extcls: 'canedit'}, {caption: me.textTabData, action: 'data', extcls: 'canedit'}, undefined, undefined, undefined, @@ -1615,7 +1615,7 @@ define([ Common.UI.Mixtbar.prototype.initialize.call(this, { template: _.template(template_view), tabs: [ - {caption: me.textTabFile, action: 'file', haspanel:false} + {caption: me.textTabFile, action: 'file', layoutname: 'toolbar-file', haspanel:false} ] } );