mirror of https://github.com/zulip/zulip.git
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:
parent
7427fb8d98
commit
b53513a5e7
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue