diff --git a/zephyr/static/js/hashchange.js b/zephyr/static/js/hashchange.js index 99760dda21..4414b95a49 100644 --- a/zephyr/static/js/hashchange.js +++ b/zephyr/static/js/hashchange.js @@ -45,7 +45,10 @@ function parse_narrow(hash) { } else { new_selection = initial_pointer; } - narrow.activate(operators, {then_select_id: new_selection}); + narrow.activate(operators, { + then_select_id: new_selection, + change_hash: false // already set + }); } // Returns true if this function performed a narrow diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index 9c9a0e33db..3f04efdf14 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -271,7 +271,8 @@ function build_filter(operators_mixed_case) { exports.activate = function (operators, opts) { opts = $.extend({}, { then_select_id: home_msg_list.selected_id(), - select_first_unread: false + select_first_unread: false, + change_hash: true }, opts); // Unfade the home view before we switch tables. @@ -350,8 +351,13 @@ exports.activate = function (operators, opts) { } search.update_highlighting(extract_search_terms(operators)); - // Put the narrow operators in the URL fragment and search bar - hashchange.save_narrow(operators); + // Put the narrow operators in the URL fragment. + // Disabled when the URL fragment was the source + // of this narrow. + if (opts.change_hash) + hashchange.save_narrow(operators); + + // Put the narrow operators in the search bar. $('#search_query').val(unparse(operators)); search.update_button_visibility(); compose.update_recipient_on_narrow();