Move remove_expanded_topics() to topic_list.js.

This commit is contained in:
Steve Howell
2016-10-26 16:53:47 -07:00
committed by Tim Abbott
parent 9b6b743a1a
commit 8783a0e51d
2 changed files with 7 additions and 7 deletions

View File

@@ -204,11 +204,6 @@ function zoom_out() {
$("#stream_filters li.narrow-filter").show(); $("#stream_filters li.narrow-filter").show();
} }
function remove_expanded_topics() {
popovers.hide_topic_sidebar_popover();
$("ul.expanded_subjects").remove();
}
function remove_expanded_private_messages() { function remove_expanded_private_messages() {
popovers.hide_topic_sidebar_popover(); popovers.hide_topic_sidebar_popover();
$("ul.expanded_private_messages").remove(); $("ul.expanded_private_messages").remove();
@@ -222,7 +217,7 @@ function reset_to_unnarrowed(narrowed_within_same_stream) {
private_messages_open = false; private_messages_open = false;
$("ul.filters li").removeClass('active-filter active-sub-filter'); $("ul.filters li").removeClass('active-filter active-sub-filter');
remove_expanded_topics(); topic_list.remove_expanded_topics();
remove_expanded_private_messages(); remove_expanded_private_messages();
} }
@@ -444,7 +439,7 @@ exports._build_private_messages_list = function (active_conversation, max_privat
function rebuild_recent_topics(stream, active_topic) { function rebuild_recent_topics(stream, active_topic) {
// TODO: Call rebuild_recent_topics less, not on every new // TODO: Call rebuild_recent_topics less, not on every new
// message. // message.
remove_expanded_topics(); topic_list.remove_expanded_topics();
var max_subjects = 5; var max_subjects = 5;
var stream_li = get_filter_li('stream', stream); var stream_li = get_filter_li('stream', stream);

View File

@@ -19,6 +19,11 @@ function iterate_to_find(selector, name_to_find, context) {
return found ? $(found) : $(); return found ? $(found) : $();
} }
exports.remove_expanded_topics = function () {
popovers.hide_topic_sidebar_popover();
$("ul.expanded_subjects").remove();
};
function get_topic_filter_li(stream_li, topic) { function get_topic_filter_li(stream_li, topic) {
return iterate_to_find(".expanded_subjects li.expanded_subject", topic, stream_li); return iterate_to_find(".expanded_subjects li.expanded_subject", topic, stream_li);
} }