Rearrange code for clarity.

This commit just moves around some lines so that the code that
hides the main view and shows the filtered view, or vice versa,
are together so that it's easier to reason about the sequence
of things that's happening.

(imported from commit 7e99f45293c0e1a4cdfa1a08f41f8c770c370d6c)
This commit is contained in:
Waseem Daher
2013-01-09 17:22:21 -05:00
parent a629f7edf6
commit 9fb6edfb96

View File

@@ -206,13 +206,12 @@ exports.activate = function (operators, opts) {
}
// Show the new set of messages.
$("#zfilt").addClass("focused_table");
reset_load_more_status();
$("#main_div").addClass("narrowed_view");
$("#searchbox").addClass("narrowed_view");
$("#zfilt").addClass("focused_table");
$("#zhome").removeClass("focused_table");
reset_load_more_status();
// Indicate both which message is persistently selected and which
// is temporarily selected
select_message_by_id(persistent_message_id,
@@ -281,12 +280,12 @@ exports.deactivate = function () {
filter_function = false;
current_operators = false;
$("#zfilt").removeClass('focused_table');
$("#zhome").addClass('focused_table');
reset_load_more_status();
$("#main_div").removeClass('narrowed_view');
$("#searchbox").removeClass('narrowed_view');
$("#zfilt").removeClass('focused_table');
$("#zhome").addClass('focused_table');
$('#search_query').val('');
reset_load_more_status();
// Includes scrolling.
select_message_by_id(persistent_message_id, {then_scroll: true});