From fd81e04e16bbb3960f6454422e1f1688a3cc33f9 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 18 Sep 2013 11:30:26 -0400 Subject: [PATCH] Remove topic popovers when redrawing topics (imported from commit 5350e5026dcfc9542c44b576ee967423adaf2c91) --- static/js/stream_list.js | 11 ++++++++--- static/js/ui.js | 2 -- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 040c74b6d6..cc567022ca 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -174,10 +174,15 @@ exports.remove_all_narrow_filters = function () { $("#stream_filters").children().remove(); }; +function remove_expanded_subjects() { + popovers.hide_topic_sidebar_popover(); + $("ul.expanded_subjects").remove(); +} + function rebuild_recent_subjects(stream, subject) { // TODO: Call rebuild_recent_subjects less, not on every new // message. - $('.expanded_subjects').remove(); + remove_expanded_subjects(); var max_subjects = 5; var stream_li = get_filter_li('stream', stream); var subjects = recent_subjects.get(stream) || []; @@ -295,7 +300,7 @@ exports.update_dom_with_unread_counts = function (counts) { $(function () { $(document).on('narrow_activated.zulip', function (event) { $("ul.filters li").removeClass('active-filter active-subject-filter'); - $('.expanded_subjects').remove(); + remove_expanded_subjects(); // TODO: handle confused filters like "in:all stream:foo" var op_in = event.filter.operands('in'); @@ -331,7 +336,7 @@ $(function () { $(document).on('narrow_deactivated.zulip', function (event) { $("ul.filters li").removeClass('active-filter active-subject-filter'); - $("ul.expanded_subjects").remove(); + remove_expanded_subjects(); $("#global_filters li[data-name='home']").addClass('active-filter'); }); diff --git a/static/js/ui.js b/static/js/ui.js index 70b65a1f39..54ed78ae4e 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -1276,8 +1276,6 @@ $(function () { ui.change_tab_to('#home'); } - popovers.hide_all(); - var stream = $(e.target).parents('ul').attr('data-stream'); var subject = $(e.target).parents('li').attr('data-name');