From b4103798f51fe143134a7f71c33eee96b75ac9fd Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Tue, 11 Sep 2012 15:37:09 -0400 Subject: [PATCH] Speed up narrowing (imported from commit e1f06866ebc7d3dae3a5813565002853a6f6d8ba) --- zephyr/static/js/zephyr.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index a5b8d0a461..bb9c5aec12 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -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();