diff --git a/static/js/subs.js b/static/js/subs.js index 70fbf1656a..65cc28f4ad 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -1176,6 +1176,20 @@ $(function () { hash_util.encodeHashComponent(sub.name); } + function show_stream_row(node, show_settings) { + $(".display-type #add_new_stream_title").hide(); + $(".display-type #stream_settings_title, .right .settings").show(); + $(".stream-row.active").removeClass("active"); + if (show_settings) { + show_subs_pane.settings(); + + $(node).addClass("active"); + exports.show_settings_for(get_stream_id(node)); + } else { + show_subs_pane.nothing_selected(); + } + } + $("#subscriptions_table").on("click", ".sub_unsub_button", function (e) { var sub = get_sub_for_target(e.target); exports.sub_or_unsub(sub); @@ -1278,20 +1292,6 @@ $(function () { exports.invite_user_to_stream(principal, sub, invite_success, invite_failure); }); - function show_stream_row(node, show_settings) { - $(".display-type #add_new_stream_title").hide(); - $(".display-type #stream_settings_title, .right .settings").show(); - $(".stream-row.active").removeClass("active"); - if (show_settings) { - show_subs_pane.settings(); - - $(node).addClass("active"); - exports.show_settings_for(get_stream_id(node)); - } else { - show_subs_pane.nothing_selected(); - } - } - $("#subscriptions_table").on("click", ".stream-row", function (e) { if ($(e.target).closest(".check, .subscription_settings").length === 0) { show_stream_row(this, true);