mirror of https://github.com/zulip/zulip.git
Speed up narrowing
(imported from commit e1f06866ebc7d3dae3a5813565002853a6f6d8ba)
This commit is contained in:
parent
34a7ad5be0
commit
b4103798f5
|
@ -326,6 +326,10 @@ function apply_view(element) {
|
|||
}
|
||||
|
||||
function do_narrow(description, filter_function) {
|
||||
// Hide the messages temporarily, so the browser doesn't waste time
|
||||
// incrementally recalculating the layout.
|
||||
$("#main_div").hide();
|
||||
|
||||
// We want the zephyr on which the narrow happened to stay in the same place if possible.
|
||||
var old_top = $("#main_div").offset().top - get_selected_zephyr_row().offset().top;
|
||||
current_view_predicate = filter_function;
|
||||
|
@ -333,6 +337,9 @@ function do_narrow(description, filter_function) {
|
|||
apply_view($(this));
|
||||
});
|
||||
|
||||
// Show the new set of messages.
|
||||
$("#main_div").show();
|
||||
|
||||
select_zephyr(selected_zephyr_id);
|
||||
scroll_to_selected();
|
||||
|
||||
|
|
Loading…
Reference in New Issue