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

View file

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

View file

@ -76,7 +76,7 @@ define([
'render:before' : function (toolbar) { 'render:before' : function (toolbar) {
var config = DE.getController('Main').appOptions; var config = DE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config)); 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)); toolbar.setExtra('left', me.header.getPanel('left', config));
}, },
'view:compact' : function (toolbar, state) { 'view:compact' : function (toolbar, state) {
@ -162,7 +162,7 @@ define([
if ( panel ) panel.height = _intvars.get('toolbar-height-tabs'); 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; var $title = me.viewport.vlayout.getItem('title').el;
$title.html(me.header.getPanel('title', config)).show(); $title.html(me.header.getPanel('title', config)).show();
$title.find('.extra').html(me.header.getPanel('left', config)); $title.find('.extra').html(me.header.getPanel('left', config));

View file

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

View file

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

View file

@ -77,7 +77,7 @@ define([
'render:before' : function (toolbar) { 'render:before' : function (toolbar) {
var config = PE.getController('Main').appOptions; var config = PE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config)); 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)); toolbar.setExtra('left', me.header.getPanel('left', config));
}, },
'view:compact' : function (toolbar, state) { 'view:compact' : function (toolbar, state) {
@ -165,7 +165,7 @@ define([
me.viewport.vlayout.getItem('toolbar').height = _intvars.get('toolbar-height-compact'); 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; var $title = me.viewport.vlayout.getItem('title').el;
$title.html(me.header.getPanel('title', config)).show(); $title.html(me.header.getPanel('title', config)).show();
$title.find('.extra').html(me.header.getPanel('left', config)); $title.find('.extra').html(me.header.getPanel('left', config));

View file

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

View file

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

View file

@ -78,10 +78,10 @@ define([
'render:before' : function (toolbar) { 'render:before' : function (toolbar) {
var config = SSE.getController('Main').appOptions; var config = SSE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config)); 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)); 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; toolbar.btnCollabChanges = me.header.btnSave;
}, },
@ -148,7 +148,7 @@ define([
me.viewport.vlayout.getItem('toolbar').height = 41; 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; var $title = me.viewport.vlayout.getItem('title').el;
$title.html(me.header.getPanel('title', config)).show(); $title.html(me.header.getPanel('title', config)).show();
$title.find('.extra').html(me.header.getPanel('left', config)); $title.find('.extra').html(me.header.getPanel('left', config));

View file

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