Hide toolbar tabs

This commit is contained in:
Julia Radzhabova 2021-10-08 13:24:56 +03:00
parent ad2fa65fca
commit d9f719f870
8 changed files with 20 additions and 18 deletions

View file

@ -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

View file

@ -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));

View file

@ -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}
]
}
);

View file

@ -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();
}
}

View file

@ -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}
]
}
);

View file

@ -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();
}
}

View file

@ -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());
}
}

View file

@ -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}
]
}
);