Branding refactoring
This commit is contained in:
parent
4866923553
commit
89a704950c
|
@ -580,8 +580,6 @@
|
|||
customization: {
|
||||
about: true,
|
||||
feedback: false
|
||||
// ,compactHeader:true
|
||||
// ,toolbarBreakTabs:true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1156,6 +1156,10 @@ define([
|
|||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||
if (this.appOptions.canBranding)
|
||||
appHeader.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarBreakTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||
|
||||
|
|
|
@ -2778,7 +2778,7 @@ define([
|
|||
|
||||
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
|
||||
|
||||
if (!config.canBranding || !config.customization.compactHeader) {
|
||||
if (!(config.customization && config.customization.compactHeader)) {
|
||||
// hide 'print' and 'save' buttons group and next separator
|
||||
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ define([
|
|||
'render:before' : function (toolbar) {
|
||||
var config = DE.getController('Main').appOptions;
|
||||
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||
if (!config.isEdit || config.canBranding && !!config.customization.compactHeader)
|
||||
if (!config.isEdit || config.customization && !!config.customization.compactHeader)
|
||||
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||
},
|
||||
'view:compact' : function (toolbar, state) {
|
||||
|
@ -162,7 +162,7 @@ define([
|
|||
if ( panel ) panel.height = _intvars.get('toolbar-height-tabs');
|
||||
}
|
||||
|
||||
if ( config.canBranding ) {
|
||||
if ( config.customization ) {
|
||||
if ( config.customization.toolbarBreakTabs )
|
||||
me.viewport.vlayout.getItem('toolbar').el.addClass('style-off-tabs');
|
||||
|
||||
|
@ -170,7 +170,7 @@ define([
|
|||
me.viewport.vlayout.getItem('toolbar').el.addClass('style-skip-docname');
|
||||
}
|
||||
|
||||
if ( config.isEdit && (!config.canBranding || !config.customization.compactHeader)) {
|
||||
if ( config.isEdit && (!(config.customization && config.customization.compactHeader))) {
|
||||
var $title = me.viewport.vlayout.getItem('title').el;
|
||||
$title.html(me.header.getPanel('title', config)).show();
|
||||
$title.find('.extra').html(me.header.getPanel('left', config));
|
||||
|
|
|
@ -1565,9 +1565,6 @@ define([
|
|||
|
||||
var me = this;
|
||||
|
||||
// if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header === false)
|
||||
// this.mnuitemHideTitleBar.hide();
|
||||
|
||||
this.btnMarkers.setMenu(
|
||||
new Common.UI.Menu({
|
||||
style: 'min-width: 139px',
|
||||
|
@ -2111,7 +2108,7 @@ define([
|
|||
|
||||
createSynchTip: function () {
|
||||
this.synchTooltip = new Common.UI.SynchronizeTip({
|
||||
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
target: this.btnCollabChanges.$el
|
||||
});
|
||||
this.synchTooltip.on('dontshowclick', function () {
|
||||
|
|
|
@ -898,6 +898,10 @@ define([
|
|||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||
if (this.appOptions.canBranding)
|
||||
appHeader.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarBreakTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||
|
||||
|
|
|
@ -2019,7 +2019,7 @@ define([
|
|||
|
||||
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
|
||||
|
||||
if (!config.canBranding || !config.customization.compactHeader) {
|
||||
if (!(config.customization && config.customization.compactHeader)) {
|
||||
// hide 'print' and 'save' buttons group and next separator
|
||||
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ define([
|
|||
'render:before' : function (toolbar) {
|
||||
var config = PE.getController('Main').appOptions;
|
||||
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||
if (!config.isEdit || config.canBranding && !!config.customization.compactHeader)
|
||||
if (!config.isEdit || config.customization && !!config.customization.compactHeader)
|
||||
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||
},
|
||||
'view:compact' : function (toolbar, state) {
|
||||
|
@ -165,7 +165,7 @@ define([
|
|||
me.viewport.vlayout.getItem('toolbar').height = _intvars.get('toolbar-height-compact');
|
||||
}
|
||||
|
||||
if ( config.isEdit && (!config.canBranding || !config.customization.compactHeader)) {
|
||||
if ( config.isEdit && (!(config.customization && config.customization.compactHeader))) {
|
||||
var $title = me.viewport.vlayout.getItem('title').el;
|
||||
$title.html(me.header.getPanel('title', config)).show();
|
||||
$title.find('.extra').html(me.header.getPanel('left', config));
|
||||
|
@ -185,7 +185,7 @@ define([
|
|||
toolbar.btnCollabChanges = me.header.btnSave;
|
||||
}
|
||||
|
||||
if ( config.canBranding ) {
|
||||
if ( config.customization ) {
|
||||
if ( config.customization.toolbarBreakTabs )
|
||||
me.viewport.vlayout.getItem('toolbar').el.addClass('style-off-tabs');
|
||||
|
||||
|
|
|
@ -1429,7 +1429,7 @@ define([
|
|||
|
||||
createSynchTip: function () {
|
||||
this.synchTooltip = new Common.UI.SynchronizeTip({
|
||||
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
target: this.btnCollabChanges.$el
|
||||
});
|
||||
this.synchTooltip.on('dontshowclick', function () {
|
||||
|
|
|
@ -917,6 +917,10 @@ define([
|
|||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||
if (this.appOptions.canBranding)
|
||||
this.headerView.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarBreakTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && this.headerView.setCanRename(true);
|
||||
} else
|
||||
|
|
|
@ -3111,7 +3111,7 @@ define([
|
|||
if ( $panel )
|
||||
me.toolbar.addTab(tab, $panel, 4);
|
||||
|
||||
if (!config.canBranding || !config.customization.compactHeader) {
|
||||
if (!(config.customization && config.customization.compactHeader)) {
|
||||
// hide 'print' and 'save' buttons group and next separator
|
||||
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
|
||||
|
||||
|
|
|
@ -78,10 +78,10 @@ define([
|
|||
'render:before' : function (toolbar) {
|
||||
var config = SSE.getController('Main').appOptions;
|
||||
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||
if (!config.isEdit || config.canBranding && !!config.customization.compactHeader)
|
||||
if (!config.isEdit || config.customization && !!config.customization.compactHeader)
|
||||
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||
|
||||
if ( me.appConfig && me.appConfig.isEdit && (!config.canBranding || !config.customization.compactHeader) && toolbar.btnCollabChanges )
|
||||
if ( me.appConfig && me.appConfig.isEdit && !(config.customization && config.customization.compactHeader) && toolbar.btnCollabChanges )
|
||||
toolbar.btnCollabChanges = me.header.btnSave;
|
||||
|
||||
},
|
||||
|
@ -148,7 +148,7 @@ define([
|
|||
me.viewport.vlayout.getItem('toolbar').height = 41;
|
||||
}
|
||||
|
||||
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && (!config.canBranding || !config.customization.compactHeader)) {
|
||||
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && !(config.customization && config.customization.compactHeader)) {
|
||||
var $title = me.viewport.vlayout.getItem('title').el;
|
||||
$title.html(me.header.getPanel('title', config)).show();
|
||||
$title.find('.extra').html(me.header.getPanel('left', config));
|
||||
|
@ -165,7 +165,7 @@ define([
|
|||
$filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height'));
|
||||
}
|
||||
|
||||
if ( config.canBranding ) {
|
||||
if ( config.customization ) {
|
||||
if ( config.customization.toolbarBreakTabs )
|
||||
me.viewport.vlayout.getItem('toolbar').el.addClass('style-off-tabs');
|
||||
|
||||
|
|
|
@ -2092,7 +2092,7 @@ define([
|
|||
|
||||
createSynchTip: function () {
|
||||
this.synchTooltip = new Common.UI.SynchronizeTip({
|
||||
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
extCls: (this.mode.customization && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
|
||||
target: this.btnCollabChanges.$el
|
||||
});
|
||||
this.synchTooltip.on('dontshowclick', function() {
|
||||
|
|
Loading…
Reference in a new issue