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

View file

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