diff --git a/CHANGELOG.md b/CHANGELOG.md index 68306298ab2..b1fc66a09f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ - Fix invalid line break characters in multi-line text in Sieve scripts (#9543) - Fix bug where "with attachment" filter could fail on some fts engines (#9514) - Fix bug where an unhandled exception was caused by an invalid image attachment (#9475) +- Fix bug where a long subject title could not be displayed in some cases (#9416) ## Release 1.6.7 diff --git a/program/js/app.js b/program/js/app.js index 50949257752..1138154b33a 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -2494,7 +2494,7 @@ function rcube_webmail() { query[uid_param] = uid; cols.subject = '' + cols.subject + ''; + + ' onmouseover="rcube_webmail.long_subject_title(this)" tabindex="-1">' + cols.subject + ''; } // add each submitted col @@ -10659,8 +10659,15 @@ function rcube_webmail() { // some static methods rcube_webmail.long_subject_title = function (elem, indent, text_elem) { if (!elem.title) { - var $elem = $(text_elem || elem); - if ($elem.width() + (indent || 0) * 15 > $elem.parent().width()) { + var siblings_width = 0, $elem = $(text_elem || elem); + + $elem.siblings().each(function () { + // Note: width() returns 0 for elements with icons in :before (Elastic) + siblings_width += $(this).width() + (parseFloat(window.getComputedStyle(this, ':before').width) || 0); + }); + + // Note: 3px to be on the safe side, but also specifically for Elastic + if ($elem.width() + siblings_width + (indent || 0) * 15 >= $elem.parent().width() - 3) { elem.title = rcube_webmail.subject_text($elem[0]); } }