From 200fd7ff709f8ff6822b8bf92d75af28df4c4dfa Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 3 Apr 2013 14:00:28 -0400 Subject: [PATCH] Fix clicking on streams in left sidebar from subscriptions page. We previously had 2 mechanisms for narrowing used by the left sidebar -- the top few links used the hashchange mechanism, while the streams links used a custom click handler. Both were buggy -- the hashchange one hadn't been updated to just select the first unread message, whereas the click handler didn't change tabs. Fixes #1141. (imported from commit 8a8af974e78cc5c33937ac0078f04a9b5452b94a) --- zephyr/static/js/hashchange.js | 8 +------- zephyr/static/js/ui.js | 7 ------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/zephyr/static/js/hashchange.js b/zephyr/static/js/hashchange.js index a1a536d429..7e4bf29640 100644 --- a/zephyr/static/js/hashchange.js +++ b/zephyr/static/js/hashchange.js @@ -53,14 +53,8 @@ function parse_narrow(hash) { var operand = decodeHashComponent(hash[i+1] || ''); operators.push([operator, operand]); } - var new_selection; - if (current_msg_list.selected_id() !== -1) { - new_selection = current_msg_list.selected_id(); - } else { - new_selection = page_params.initial_pointer; - } narrow.activate(operators, { - then_select_id: new_selection, + select_first_unread: true, change_hash: false // already set }); } diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index b6ed7d7c10..5f3c246f7b 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -985,13 +985,6 @@ $(function () { compose.start('private', {private_message_recipient: email}); e.preventDefault(); }); - - $('#stream_filters li').on('click', 'a', function (e) { - var stream = $(e.target).parents('li').data('name'); - narrow.by('stream', stream, {select_first_unread: true}); - - e.preventDefault(); - }); }); function sort_narrow_list() {