From 13f5d30d8337d5367ab7d8ca199f38b9205e78d6 Mon Sep 17 00:00:00 2001 From: Jeff Arnold Date: Thu, 18 Apr 2013 21:45:34 -0400 Subject: [PATCH] Revert "Don't collapse messages that would only be collapsed by a small amount" This reverts commit 56e8df87d3eae62080962474eae23ab75f009819. (imported from commit 15d71ab73d269eaa3d8a2f52c5781290ee183627) --- zephyr/static/js/message_list.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/zephyr/static/js/message_list.js b/zephyr/static/js/message_list.js index 1881134ab1..666929897f 100644 --- a/zephyr/static/js/message_list.js +++ b/zephyr/static/js/message_list.js @@ -401,18 +401,9 @@ MessageList.prototype = { var content = $(elem).find(".message_content")[0]; if (content !== undefined) { - // We've limited the height of all elements in CSS. - // If offsetHeight < scrollHeight, then our CSS height limit has taken - // 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) { + if( content.offsetHeight < content.scrollHeight || + content.offsetWidth < content.scrollWidth) { $(elem).find(".message_expander").show(); - } else if (content.offsetHeight < content.scrollHeight) { - $(content).addClass("expanded"); } } });