[common] debug centering for doc title

This commit is contained in:
Maxim Kadushkin 2020-07-29 22:50:07 +03:00
parent c5b46c8955
commit e37deabb02
2 changed files with 57 additions and 51 deletions

View file

@ -78,30 +78,32 @@ define([
'<label id="rib-doc-name" />' + '<label id="rib-doc-name" />' +
'</section>' + '</section>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' + '<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' + '<section style="display: inherit;">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' + '<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' + '<div class="btn-slot" id="slot-hbtn-print"></div>' +
'</div>' + '<div class="btn-slot" id="slot-hbtn-download"></div>' +
'<div class="hedset">' + '</div>' +
// '<span class="btn-slot text" id="slot-btn-users"></span>' + '<div class="hedset">' +
'<section id="tlb-box-users" class="box-cousers dropdown"">' + // '<span class="btn-slot text" id="slot-btn-users"></span>' +
'<div class="btn-users">' + '<section id="tlb-box-users" class="box-cousers dropdown"">' +
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' + '<div class="btn-users">' +
'<label class="caption">&plus;</label>' + '<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
'</div>' + '<label class="caption">&plus;</label>' +
'<div class="cousers-menu dropdown-menu">' + '</div>' +
'<label id="tlb-users-menu-descr"><%= tipUsers %></label>' + '<div class="cousers-menu dropdown-menu">' +
'<div class="cousers-list"></div>' + '<label id="tlb-users-menu-descr"><%= tipUsers %></label>' +
'<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' + '<div class="cousers-list"></div>' +
'</div>' + '<label id="tlb-change-rights" class="link"><%= txtAccessRights %></label>' +
'</section>'+ '</div>' +
'</div>' + '</section>'+
'<div class="hedset">' + '</div>' +
'<div class="btn-slot" id="slot-btn-undock"></div>' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-back"></div>' + '<div class="btn-slot" id="slot-btn-undock"></div>' +
'<div class="btn-slot" id="slot-btn-options"></div>' + '<div class="btn-slot" id="slot-btn-back"></div>' +
'</div>' + '<div class="btn-slot" id="slot-btn-options"></div>' +
'</div>' +
'</section>' +
'</section>'; '</section>';
var templateLeftBox = '<section class="logo">' + var templateLeftBox = '<section class="logo">' +
@ -110,7 +112,7 @@ define([
var templateTitleBox = '<section id="box-document-title">' + var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' + '<div class="extra"></div>' +
'<div class="hedset" id="header-tools">' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-dt-save"></div>' + '<div class="btn-slot" id="slot-btn-dt-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' + '<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' + '<div class="btn-slot" id="slot-btn-dt-undo"></div>' +
@ -213,9 +215,9 @@ define([
'</div>'); '</div>');
} }
var $tools = this.btnSave.$el.parent('#header-tools'); var $parent = this.labelDocName.parent();
var _left_width = $tools.prev().outerWidth() + $tools.outerWidth(), var _left_width = $parent.position().left,
_right_width = this.labelUserName.outerWidth(); _right_width = $parent.next().outerWidth();
if ( _left_width < _right_width ) if ( _left_width < _right_width )
this.labelDocName.parent().css('padding-left', _right_width - _left_width); this.labelDocName.parent().css('padding-left', _right_width - _left_width);
@ -241,34 +243,36 @@ define([
} }
}); });
onResetUsers(storeUsers); if ( $panelUsers ) {
onResetUsers(storeUsers);
$panelUsers.on('shown.bs.dropdown', function () { $panelUsers.on('shown.bs.dropdown', function () {
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true}); $userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
}); });
$panelUsers.find('.cousers-menu') $panelUsers.find('.cousers-menu')
.on('click', function(e) { return false; }); .on('click', function(e) { return false; });
var editingUsers = storeUsers.getEditingCount(); var editingUsers = storeUsers.getEditingCount();
$btnUsers.tooltip({ $btnUsers.tooltip({
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights, title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.isRestrictedEdit) ? me.tipViewUsers : me.tipAccessRights,
titleNorm: me.tipAccessRights, titleNorm: me.tipAccessRights,
titleExt: me.tipViewUsers, titleExt: me.tipViewUsers,
placement: 'bottom', placement: 'bottom',
html: true html: true
}); });
$btnUsers.on('click', onUsersClick.bind(me)); $btnUsers.on('click', onUsersClick.bind(me));
var $labelChangeRights = $panelUsers.find('#tlb-change-rights'); var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
$labelChangeRights.on('click', function(e) { $labelChangeRights.on('click', function(e) {
$panelUsers.removeClass('open'); $panelUsers.removeClass('open');
Common.NotificationCenter.trigger('collaboration:sharing'); Common.NotificationCenter.trigger('collaboration:sharing');
}); });
$labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide'](); $labelChangeRights[(!mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide'](); $panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
}
if ( $saveStatus ) { if ( $saveStatus ) {
$saveStatus.attr('data-width', me.textSaveExpander); $saveStatus.attr('data-width', me.textSaveExpander);

View file

@ -77,7 +77,9 @@ define([
'Toolbar': { 'Toolbar': {
'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)); if (!config.isEditDiagram && !config.isEditMailMerge)
toolbar.setExtra('right', me.header.getPanel('right', config));
if (!config.isEdit || config.customization && !!config.customization.compactHeader) if (!config.isEdit || config.customization && !!config.customization.compactHeader)
toolbar.setExtra('left', me.header.getPanel('left', config)); toolbar.setExtra('left', me.header.getPanel('left', config));