From 9fb6edfb9614f00c01e9f7f18a60e8eaac6bf504 Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Wed, 9 Jan 2013 17:22:21 -0500 Subject: [PATCH] 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) --- zephyr/static/js/narrow.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index b280200092..010fc3f055 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -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});