mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
compose: Fix loss of message fading on renarrow.
Previously, if you renarrowed, all message fading would be cleared until you close and then reopen the compose box. Fixes #1024. (imported from commit 57981ba29ab597c4c84ca6e4e9d04a8284f49117)
This commit is contained in:
@@ -100,14 +100,16 @@ function fade_around(reply_message) {
|
|||||||
ui.disable_floating_recipient_bar();
|
ui.disable_floating_recipient_bar();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.unfade_messages = function () {
|
exports.unfade_messages = function (clear_state) {
|
||||||
if (faded_to === undefined) {
|
if (faded_to === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fade_class = narrow.active() ? "message_reply_fade_narrowed" : "message_reply_fade";
|
var fade_class = narrow.active() ? "message_reply_fade_narrowed" : "message_reply_fade";
|
||||||
rows.get_table(current_msg_list.table_name).find(".recipient_row, .messagebox").removeClass(fade_class);
|
rows.get_table(current_msg_list.table_name).find(".recipient_row, .messagebox").removeClass(fade_class);
|
||||||
|
if (clear_state === true) {
|
||||||
faded_to = undefined;
|
faded_to = undefined;
|
||||||
|
}
|
||||||
ui.enable_floating_recipient_bar();
|
ui.enable_floating_recipient_bar();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,7 +167,7 @@ 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)) {
|
if (exports.composing() && (faded_to !== opts.replying_to_message)) {
|
||||||
// Already faded to another message. First unfade everything.
|
// Already faded to another message. First unfade everything.
|
||||||
exports.unfade_messages();
|
exports.unfade_messages(true);
|
||||||
}
|
}
|
||||||
fade_around(opts.replying_to_message);
|
fade_around(opts.replying_to_message);
|
||||||
}
|
}
|
||||||
@@ -274,7 +276,7 @@ exports.hide = function () {
|
|||||||
$('.message_comp').slideUp(100,
|
$('.message_comp').slideUp(100,
|
||||||
function() { $('#compose').css({visibility: "hidden"});});
|
function() { $('#compose').css({visibility: "hidden"});});
|
||||||
notifications_bar.enable();
|
notifications_bar.enable();
|
||||||
exports.unfade_messages();
|
exports.unfade_messages(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.clear = function () {
|
exports.clear = function () {
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ exports.activate = function (operators, opts) {
|
|||||||
hashchange.save_narrow(operators);
|
hashchange.save_narrow(operators);
|
||||||
$('#search_query').val(unparse(operators));
|
$('#search_query').val(unparse(operators));
|
||||||
search.update_button_visibility();
|
search.update_button_visibility();
|
||||||
|
compose.update_faded_messages();
|
||||||
|
|
||||||
$("ul.filters li").removeClass('active-filter');
|
$("ul.filters li").removeClass('active-filter');
|
||||||
if (operators.length === 1) {
|
if (operators.length === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user