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)
This commit is contained in:
Jessica McKellar
2012-11-21 14:22:20 -05:00
parent dad00fa29f
commit 89582bff8a

View File

@@ -122,11 +122,13 @@ function replace_floating_recipient_bar(desired_label) {
desired_label.children(".message_header_stream.right_part").clone()); desired_label.children(".message_header_stream.right_part").clone());
$("#current_label_huddle").css('display', 'none'); $("#current_label_huddle").css('display', 'none');
$("#current_label_stream").css('display', 'table-row'); $("#current_label_stream").css('display', 'table-row');
$("#current_label_stream").attr("zid", desired_label.attr("zid"));
} else { } else {
$("#current_label_huddle td:last").replaceWith( $("#current_label_huddle td:last").replaceWith(
desired_label.children(".message_header_huddle.right_part").clone()); desired_label.children(".message_header_huddle.right_part").clone());
$("#current_label_stream").css('display', 'none'); $("#current_label_stream").css('display', 'none');
$("#current_label_huddle").css('display', 'table-row'); $("#current_label_huddle").css('display', 'table-row');
$("#current_label_huddle").attr("zid", desired_label.attr("zid"));
} }
old_label = desired_label; 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"); var row = $(this).closest(".recipient_row");
narrow.target(row.attr('zid')); narrow.target(row.attr('zid'));
narrow.by_recipient(); 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"); var row = $(this).closest(".recipient_row");
narrow.target(row.attr('zid')); narrow.target(row.attr('zid'));
narrow.by_subject(); narrow.by_subject();