@thinkpixellab-public/px-vue 4.0.28 → 4.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/balanceText.js +7 -1
package/package.json
CHANGED
package/utils/balanceText.js
CHANGED
|
@@ -37,7 +37,13 @@ var balanceText = function (element, lineAdjust = ADJUST) {
|
|
|
37
37
|
function squeezeContainer(headline, originalHeight, bottomRange, topRange, lineAdjust = ADJUST) {
|
|
38
38
|
var mid;
|
|
39
39
|
if (bottomRange >= topRange) {
|
|
40
|
-
headline
|
|
40
|
+
// need to handle the case where the headline is not wrapping and is just too wide for it's container
|
|
41
|
+
// this mainly seems to happen when in character based languages
|
|
42
|
+
if (headline.scrollWidth > topRange * lineAdjust) {
|
|
43
|
+
headline.style.maxWidth = headline.scrollWidth + 'px';
|
|
44
|
+
} else {
|
|
45
|
+
headline.style.maxWidth = topRange * lineAdjust + 'px';
|
|
46
|
+
}
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
49
|
mid = (bottomRange + topRange) / 2;
|