Uncondense messages that have recently become "short."

It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller.  This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.

(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
This commit is contained in:
Steve Howell 2013-12-09 17:07:14 -05:00
parent 7427fb8d98
commit b53513a5e7
1 changed files with 6 additions and 1 deletions

View File

@ -1248,7 +1248,7 @@ $(function () {
if (message.collapsed) {
// Uncollapse.
ui.uncollapse(row);
} else if (content.hasClass("could-be-condensed")) {
} else if (content.hasClass("condensed")) {
// Uncondense (show the full long message).
message.condensed = false;
content.removeClass("condensed");
@ -1745,6 +1745,8 @@ exports.condense_and_collapse = function (elems) {
if (long_message) {
// All long messages are flagged as such.
content.addClass("could-be-condensed");
} else {
content.removeClass("could-be-condensed");
}
// If message.condensed is defined, then the user has manually
@ -1758,6 +1760,9 @@ exports.condense_and_collapse = function (elems) {
} else if (long_message) {
// By default, condense a long message.
condense($(elem));
} else {
content.removeClass('condensed');
$(elem).find(".message_expander").hide();
}
// Completely hide the message and replace it with a [More]