mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
compose: Move unfade_messages() call inside fade_around.
This makes the API a little cleaner. (imported from commit c5eb9a4998971cdbe1f8ac3a14fd9759584771bb)
This commit is contained in:
@@ -90,10 +90,11 @@ function messages_with_different_recipients(target_message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fade_around(reply_message) {
|
function fade_around(reply_message) {
|
||||||
|
compose.unfade_messages(true);
|
||||||
|
faded_to = reply_message;
|
||||||
var i, fade_class = narrow.active() ? "message_reply_fade_narrowed" : "message_reply_fade";
|
var i, fade_class = narrow.active() ? "message_reply_fade_narrowed" : "message_reply_fade";
|
||||||
var elts_to_fade = messages_with_different_recipients(reply_message);
|
var elts_to_fade = messages_with_different_recipients(reply_message);
|
||||||
|
|
||||||
faded_to = reply_message;
|
|
||||||
for (i = 0; i < elts_to_fade.length; i++) {
|
for (i = 0; i < elts_to_fade.length; i++) {
|
||||||
$(elts_to_fade[i]).addClass(fade_class);
|
$(elts_to_fade[i]).addClass(fade_class);
|
||||||
}
|
}
|
||||||
@@ -189,10 +190,6 @@ exports.start = function (msg_type, opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opts.replying_to_message !== undefined) {
|
if (opts.replying_to_message !== undefined) {
|
||||||
if (exports.composing() && (faded_to !== opts.replying_to_message)) {
|
|
||||||
// Already faded to another message. First unfade everything.
|
|
||||||
exports.unfade_messages(true);
|
|
||||||
}
|
|
||||||
fade_around(opts.replying_to_message);
|
fade_around(opts.replying_to_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user