diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index dffd58f74..ed500c209 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -214,14 +214,21 @@ define([ this.imgCrypted = this.labelDocName.parent().find('.crypted'); } + var $parent = this.labelDocName.parent(); if (!config.isEdit || !config.customization || !config.customization.compactHeader) { - var $parent = this.labelDocName.parent(); var _left_width = $parent.position().left, _right_width = $parent.next().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); + $parent.css('padding-left', Math.max(2, _right_width - _left_width)); + else + $parent.css('padding-right', Math.max(2, _left_width - _right_width)); + } + + if (!(config.customization && config.customization.toolbarHideFileName) && (!config.isEdit || config.customization && config.customization.compactHeader)) { + var basis = parseFloat($parent.css('padding-left') || 0) + parseFloat($parent.css('padding-right') || 0) + parseInt(this.labelDocName.css('min-width') || 50); // 2px - box-shadow + $parent.css('flex-basis', Math.ceil(basis) + 'px'); + $parent.closest('.extra.right').css('flex-basis', Math.ceil(basis) + $parent.next().outerWidth() + 'px'); } } } @@ -759,11 +766,7 @@ define([ else name = this.labelDocName.val(); var width = this.getTextWidth(name); - if (width>=0) - { - this.labelDocName.width(width); - Common.NotificationCenter.trigger('window:resize'); - } + (width>=0) && this.labelDocName.width(width); }, getTextWidth: function(text) { diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 4675a325b..aff75f763 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -51,6 +51,8 @@ &.right { flex-grow: 1; + flex-shrink: 0; + overflow: hidden; } .status-label { @@ -94,7 +96,9 @@ flex-grow: 1; display: flex; justify-content: center; - padding: 4px 0px; + padding: 4px 2px; + overflow: hidden; + flex-shrink: 0; } #rib-doc-name { @@ -495,7 +499,7 @@ display: flex; justify-content: center; overflow: hidden; - padding: 4px 0px 2px 2px; + padding: 4px 2px; } #title-doc-name { diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index d476b5010..87c561504 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -60,8 +60,7 @@ position: relative; overflow: hidden; display: flex; - - min-width: 150px; + flex-shrink: 1; > ul { padding: 4px 0 0; @@ -561,7 +560,7 @@ } &.style-skip-docname .toolbar { - #box-doc-name > label { + #box-doc-name > input { display: none; } }