Merge pull request #440 from ONLYOFFICE/feature/fix-merge-with-release-6

[all] centered doc title depending editor width
This commit is contained in:
maxkadushkin 2020-07-28 23:31:21 +03:00 committed by GitHub
commit b253fb9f3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,6 @@ define([
'<div class="btn-slot" id="slot-btn-dt-redo"></div>' + '<div class="btn-slot" id="slot-btn-dt-redo"></div>' +
'</div>' + '</div>' +
'<div class="lr-separator" id="id-box-doc-name">' + '<div class="lr-separator" id="id-box-doc-name">' +
// '<input type="text" id="title-doc-name" spellcheck="false" data-can-copy="false" style="pointer-events: none;" disabled="disabled">' +
'<label id="title-doc-name" />' + '<label id="title-doc-name" />' +
'</div>' + '</div>' +
'<label id="title-user-name" style="pointer-events: none;"></label>' + '<label id="title-user-name" style="pointer-events: none;"></label>' +
@ -206,11 +205,21 @@ define([
} }
function onAppShowed(config) { function onAppShowed(config) {
if ( config.isCrypted && this.labelDocName ) { if ( this.labelDocName ) {
this.labelDocName.before( if ( config.isCrypted ) {
'<div class="inner-box-icon crypted">' + this.labelDocName.before(
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' + '<div class="inner-box-icon crypted">' +
'</div>'); '<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>');
}
var $tools = this.btnSave.$el.parent('#header-tools');
var _left_width = $tools.prev().outerWidth() + $tools.outerWidth(),
_right_width = this.labelUserName.outerWidth();
if ( _left_width < _right_width )
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
} }
} }