Revert "Don't collapse messages that would only be collapsed by a small amount"

This reverts commit 56e8df87d3eae62080962474eae23ab75f009819.

(imported from commit 15d71ab73d269eaa3d8a2f52c5781290ee183627)
This commit is contained in:
Jeff Arnold 2013-04-18 21:45:34 -04:00
parent 955f1febdf
commit 13f5d30d83
1 changed files with 2 additions and 11 deletions

View File

@ -401,18 +401,9 @@ MessageList.prototype = {
var content = $(elem).find(".message_content")[0]; var content = $(elem).find(".message_content")[0];
if (content !== undefined) { if (content !== undefined) {
// We've limited the height of all elements in CSS. if( content.offsetHeight < content.scrollHeight ||
// If offsetHeight < scrollHeight, then our CSS height limit has taken content.offsetWidth < content.scrollWidth) {
// effect and we should show an expander button.
// If offsetHeight is only slightly smaller than scrollHeight, then we
// would only be collapsing by a small amount, which can be annoying.
// Instead of showing an expander button, just expand that element instead
// of keeping it collapsed. (This also solves a bug seen on some Mac
// systems where offsetHeight == scrollHeight-1 for no apparent reason).
if (content.offsetHeight+50 < content.scrollHeight) {
$(elem).find(".message_expander").show(); $(elem).find(".message_expander").show();
} else if (content.offsetHeight < content.scrollHeight) {
$(content).addClass("expanded");
} }
} }
}); });