From 6dc3ef5ea831a82f3127aab73626b331dc32b283 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Tue, 14 May 2013 12:00:28 -0700 Subject: [PATCH] Break out toggling a stream in the home view into a separate export. (imported from commit 175b5f47685e60100d6fb7c4f9c4c18ffbe12cbe) --- zephyr/static/js/subs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index 3b907e23af..9611657e90 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -159,8 +159,11 @@ function set_stream_property(stream_name, property, value) { function stream_home_view_clicked(e) { var sub_row = $(e.target).closest('.subscription_row'); var stream = sub_row.find('.subscription_name').text(); + subs.toggle_home(stream); +} - var sub = get_sub(stream); +exports.toggle_home = function (stream_name) { + var sub = get_sub(stream_name); sub.in_home_view = ! sub.in_home_view; setTimeout(function () { @@ -188,8 +191,8 @@ function stream_home_view_clicked(e) { }, 0); exports.maybe_toggle_all_messages(); - set_stream_property(stream, 'in_home_view', sub.in_home_view); -} + set_stream_property(stream_name, 'in_home_view', sub.in_home_view); +}; function stream_notifications_clicked(e) { var sub_row = $(e.target).closest('.subscription_row');