Add parameter customization.compactHeader for compact header view (not for desktop)

This commit is contained in:
Julia Radzhabova 2019-01-31 16:41:29 +03:00
parent 703be670ab
commit 1767ba0ae8
10 changed files with 41 additions and 32 deletions

View file

@ -122,7 +122,8 @@
forcesave: false,
commentAuthorOnly: false,
showReviewChanges: false,
help: true
help: true,
compactHeader: false
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
@ -370,6 +371,7 @@
// _config.editorConfig.canBackToFolder = false;
if (!_config.editorConfig.customization) _config.editorConfig.customization = {};
_config.editorConfig.customization.about = false;
_config.editorConfig.customization.compactHeader = false;
if ( window.AscDesktopEditor ) window.AscDesktopEditor.execCommand('webapps:events', 'loading');
}

View file

@ -2778,15 +2778,17 @@ define([
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
if (!config.canBranding || !config.customization.compactHeader) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and retrieve parent container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// hide 'undo' and 'redo' buttons and retrieve parent container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
}
if ( config.isDesktopApp ) {
if ( config.canProtect ) {

View file

@ -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)
if (!config.isEdit || config.canBranding && !!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.isEdit ) {
if ( config.isEdit && (!config.canBranding || !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));

View file

@ -2111,7 +2111,7 @@ define([
createSynchTip: function () {
this.synchTooltip = new Common.UI.SynchronizeTip({
extCls: 'inc-index',
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
target: this.btnCollabChanges.$el
});
this.synchTooltip.on('dontshowclick', function () {

View file

@ -2018,15 +2018,18 @@ define([
me.toolbar.addTab(tab, $panel, 3);
me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
if (!config.canBranding || !config.customization.compactHeader) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
}
if ( config.isDesktopApp ) {
if ( config.canProtect ) { // don't add protect panel to toolbar

View file

@ -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)
if (!config.isEdit || config.canBranding && !!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 ) {
if ( config.isEdit && (!config.canBranding || !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));

View file

@ -1429,7 +1429,7 @@ define([
createSynchTip: function () {
this.synchTooltip = new Common.UI.SynchronizeTip({
extCls: 'inc-index',
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
target: this.btnCollabChanges.$el
});
this.synchTooltip.on('dontshowclick', function () {

View file

@ -3111,15 +3111,17 @@ define([
if ( $panel )
me.toolbar.addTab(tab, $panel, 4);
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
if (!config.canBranding || !config.customization.compactHeader) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
}
if ( config.isDesktopApp ) {
if ( config.canProtect ) {

View file

@ -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)
if (!config.isEdit || config.canBranding && !!config.customization.compactHeader)
toolbar.setExtra('left', me.header.getPanel('left', config));
if ( me.appConfig && me.appConfig.isEdit && toolbar.btnCollabChanges )
if ( me.appConfig && me.appConfig.isEdit && (!config.canBranding || !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 ) {
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && (!config.canBranding || !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));

View file

@ -2092,7 +2092,7 @@ define([
createSynchTip: function () {
this.synchTooltip = new Common.UI.SynchronizeTip({
extCls: 'inc-index',
extCls: (this.mode.canBranding && !!this.mode.customization.compactHeader) ? undefined : 'inc-index',
target: this.btnCollabChanges.$el
});
this.synchTooltip.on('dontshowclick', function() {