From 89582bff8a05a04f35ddf15a84c0525b016d6c45 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Wed, 21 Nov 2012 14:22:20 -0500 Subject: [PATCH] Fix floating recipient bar being unnarrowable. When we switched to delegated event handling, the bound handler for all of our events was #main_div, but the floating recipient bar lives outside of #main_div. Additionally, the bar needs to inherit the zid from the target recipient bar since it is used for the narrow. (imported from commit 7c18e16f2e98436888a8edb81fbbdd4d17abfe2a) --- zephyr/static/js/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 2bcf34127d..4de9e299d3 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -122,11 +122,13 @@ function replace_floating_recipient_bar(desired_label) { desired_label.children(".message_header_stream.right_part").clone()); $("#current_label_huddle").css('display', 'none'); $("#current_label_stream").css('display', 'table-row'); + $("#current_label_stream").attr("zid", desired_label.attr("zid")); } else { $("#current_label_huddle td:last").replaceWith( desired_label.children(".message_header_huddle.right_part").clone()); $("#current_label_stream").css('display', 'none'); $("#current_label_huddle").css('display', 'table-row'); + $("#current_label_huddle").attr("zid", desired_label.attr("zid")); } old_label = desired_label; } @@ -547,13 +549,13 @@ $(function () { } }); - $("#main_div").on("click", ".narrows_by_recipient", function (e) { + $("#home").on("click", ".narrows_by_recipient", function (e) { var row = $(this).closest(".recipient_row"); narrow.target(row.attr('zid')); narrow.by_recipient(); }); - $("#main_div").on("click", ".narrows_by_subject", function (e) { + $("#home").on("click", ".narrows_by_subject", function (e) { var row = $(this).closest(".recipient_row"); narrow.target(row.attr('zid')); narrow.by_subject();