[DE PE SSE] Fix two lines buttons in toolbar

This commit is contained in:
JuliaSvinareva 2022-01-11 17:52:59 +03:00
parent 2e49bc090c
commit a7c2add386
2 changed files with 7 additions and 10 deletions

View file

@ -351,8 +351,9 @@ define([
getCaptionWithBreaks: function (caption) {
var words = caption.split(' '),
newCaption = null,
maxWidth = !!this.menu ? 85 - 4 - 10 : 85 - 4;
maxWidth = 85 - 4;
if (words.length > 1) {
maxWidth = !!this.menu || this.split === true ? maxWidth - 10 : maxWidth;
if (words.length < 3) {
words[1] = getShortText(words[1], maxWidth);
newCaption = words[0] + '<br>' + words[1];
@ -368,14 +369,11 @@ define([
newCaption = words[0] + '<br>' + words[1];
}
}
} else if (!!this.menu || this.split === true) {
} else {
var width = getWidthOfCaption(caption);
if (width < maxWidth) {
newCaption = caption + '<br>';
} else if (width > maxWidth * 2 - 10) {
newCaption = getShortText(caption, maxWidth * 2 - 10);
} else {
newCaption = caption;
newCaption = width < maxWidth ? caption : getShortText(caption, maxWidth);
if (!!this.menu || this.split === true) {
newCaption += '<br>';
}
}
return newCaption;

View file

@ -241,9 +241,8 @@
max-width: 85px;
max-height: 22px;
text-overflow: ellipsis;
overflow: hidden;
white-space: pre-line;
white-space: pre;
line-height: 10px;
padding: 0 2px;