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,12 +205,22 @@ define([
} }
function onAppShowed(config) { function onAppShowed(config) {
if ( config.isCrypted && this.labelDocName ) { if ( this.labelDocName ) {
if ( config.isCrypted ) {
this.labelDocName.before( this.labelDocName.before(
'<div class="inner-box-icon crypted">' + '<div class="inner-box-icon crypted">' +
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' + '<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
'</div>'); '</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);
}
} }
function onAppReady(mode) { function onAppReady(mode) {