Ox.IconItem: fix a regression related to highlights across linebreaks; add a class to ellipsis

This commit is contained in:
rolux 2012-06-04 14:32:58 +02:00
parent da4e07fc2f
commit c4ad59bdb6

View file

@ -163,12 +163,12 @@ Ox.IconItem = function(options, self) {
// truncated rest (including the last line) and discard all extra lines // truncated rest (including the last line) and discard all extra lines
if (lines.length > maxLines) { if (lines.length > maxLines) {
lines[maxLines - 1] = Ox.truncate( lines[maxLines - 1] = Ox.truncate(
lines.slice(maxLines - 1).join(' '), 'center', maxLength lines.slice(maxLines - 1).join(''), 'center', maxLength
); ).replace('…', '<span class="OxLight">…</span>');
lines = lines.slice(0, maxLines); lines = lines.slice(0, maxLines);
} }
return Ox.highlight( return Ox.highlight(
lines.join(' <br/>'), self.options.find, 'OxHighlight', true lines.join('<br/>'), self.options.find, 'OxHighlight', true
); );
} }