Fix show-more link: don't add it twice if maxlen and maxlines are both set; show dots before link if text is truncated
This commit is contained in:
parent
f72b878493
commit
2e9c4a6529
1 changed files with 2 additions and 1 deletions
|
@ -245,7 +245,7 @@ function rcube_libcalendaring(settings)
|
|||
|
||||
// limit visible text length
|
||||
if (maxlen) {
|
||||
var morelink = ' <a href="#more" onclick="$(this).hide().next().show();return false" class="morelink">'+rcmail.gettext('showmore','libcalendaring')+'</a><span style="display:none">',
|
||||
var morelink = '<span>... <a href="#more" onclick="$(this).parent().hide().next().show();return false" class="morelink">'+rcmail.gettext('showmore','libcalendaring')+'</a></span><span style="display:none">',
|
||||
lines = html.split(/\r?\n/),
|
||||
words, out = '', len = 0;
|
||||
|
||||
|
@ -264,6 +264,7 @@ function rcube_libcalendaring(settings)
|
|||
if (len > maxlen) {
|
||||
out += morelink;
|
||||
maxlen = html.length * 2;
|
||||
maxlines = 0;
|
||||
}
|
||||
}
|
||||
out += '\n';
|
||||
|
|
Loading…
Add table
Reference in a new issue