Set header layout as in the desktop editors

This commit is contained in:
Julia Radzhabova 2018-09-25 13:46:28 +03:00
parent ccf95bc87a
commit 88998b07aa
10 changed files with 48 additions and 41 deletions

View file

@ -106,6 +106,7 @@ define([
'</section>';
var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' +

View file

@ -2758,17 +2758,18 @@ define([
me.toolbar.addTab(tab, $panel, 4);
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 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');
if ( config.isDesktopApp ) {
// 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();
// 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.canProtect ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();

View file

@ -76,7 +76,8 @@ define([
'render:before' : function (toolbar) {
var config = DE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
if (!config.isEdit)
toolbar.setExtra('left', me.header.getPanel('left', config));
},
'view:compact' : function (toolbar, state) {
me.header.mnuitemCompactToolbar.setChecked(state, true);
@ -157,9 +158,10 @@ define([
if ( panel ) panel.height = _intvars.get('toolbar-height-tabs');
}
if ( config.isDesktopApp && config.isEdit ) {
if ( config.isEdit ) {
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));
var toolbar = me.viewport.vlayout.getItem('toolbar');
toolbar.el.addClass('top-title');

View file

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

View file

@ -2007,17 +2007,17 @@ define([
if ( $panel )
me.toolbar.addTab(tab, $panel, 3);
// 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();
// 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 ) {
// 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();
// 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.canProtect ) { // don't add protect panel to toolbar
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();

View file

@ -77,7 +77,8 @@ define([
'render:before' : function (toolbar) {
var config = PE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
if (!config.isEdit)
toolbar.setExtra('left', me.header.getPanel('left', config));
},
'view:compact' : function (toolbar, state) {
me.header.mnuitemCompactToolbar.setChecked(state, true);
@ -160,9 +161,10 @@ define([
me.viewport.vlayout.getItem('toolbar').height = _intvars.get('toolbar-height-compact');
}
if ( config.isDesktopApp && config.isEdit ) {
if ( config.isEdit ) {
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));
var toolbar = me.viewport.vlayout.getItem('toolbar');
toolbar.el.addClass('top-title');

View file

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

View file

@ -3096,17 +3096,17 @@ define([
if ( $panel )
me.toolbar.addTab(tab, $panel, 5);
// 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();
// 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 ) {
// 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();
// 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.canProtect ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();

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));
toolbar.setExtra('left', me.header.getPanel('left', config));
if (!config.isEdit)
toolbar.setExtra('left', me.header.getPanel('left', config));
if ( me.appConfig && me.appConfig.isDesktopApp &&
me.appConfig.isEdit && toolbar.btnCollabChanges )
if ( me.appConfig && me.appConfig.isEdit && toolbar.btnCollabChanges )
toolbar.btnCollabChanges = me.header.btnSave;
},
@ -144,9 +144,10 @@ define([
me.viewport.vlayout.getItem('toolbar').height = 41;
}
if ( config.isDesktopApp && config.isEdit && !config.isEditDiagram && !config.isEditMailMerge ) {
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge ) {
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));
var toolbar = me.viewport.vlayout.getItem('toolbar');
toolbar.el.addClass('top-title');

View file

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