From 2ae2727c8bc4a4aa33cbc273a9604aec5f5cb83c Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Mon, 2 Oct 2017 15:41:13 -0700 Subject: [PATCH] streams: Refactor `actually_filter_streams` to be public. This refactors the function to be publicly accessible so we can call the filter streams function from other modules. --- static/js/subs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/js/subs.js b/static/js/subs.js index 996df23be8..f8160195b7 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -312,7 +312,7 @@ exports.filter_table = function (query) { $(".streams-list").scrollTop(streams_list_scrolltop); }; -function actually_filter_streams() { +exports.actually_filter_streams = function () { var search_box = $("#add_new_subscription input[type='text']"); var query = search_box.expectOne().val().trim(); var subscribed_only; @@ -322,9 +322,9 @@ function actually_filter_streams() { subscribed_only = false; } exports.filter_table({ input: query, subscribed_only: subscribed_only }); -} +}; -var filter_streams = _.throttle(actually_filter_streams, 50); +var filter_streams = _.throttle(exports.actually_filter_streams, 50); exports.setup_page = function (callback) { function initialize_components() { @@ -343,7 +343,7 @@ exports.setup_page = function (callback) { window.location.hash = "streams/subscribed"; } - actually_filter_streams(); + exports.actually_filter_streams(); remove_temporarily_miscategorized_streams(); }, }).get(); @@ -369,7 +369,7 @@ exports.setup_page = function (callback) { var rendered = templates.render('subscription_table_body', template_data); $('#subscriptions_table').append(rendered); initialize_components(); - actually_filter_streams(); + exports.actually_filter_streams(); var email_address_hint_content = templates.render('email_address_hint', { page_params: page_params }); _.each(sub_rows, function (row) { add_email_hint(row, email_address_hint_content);