Fix display of original string length in debug output for ellipsize()

This commit is contained in:
Dan Stillman 2019-07-17 21:32:51 -04:00
parent 370e2cc6e7
commit a41e610e6c

View file

@ -883,6 +883,7 @@ Zotero.Utilities = {
if (str.length <= len) {
return str;
}
var origLen = str.length;
let radius = Math.min(len, 5);
if (wordBoundary) {
let min = len - radius;
@ -896,7 +897,7 @@ Zotero.Utilities = {
else {
str = str.substr(0, len)
}
return str + '\u2026' + (countChars ? ' (' + str.length + ' chars)' : '');
return str + '\u2026' + (countChars ? ' (' + origLen + ' chars)' : '');
},