Break out toggling a stream in the home view into a separate export.

(imported from commit 175b5f47685e60100d6fb7c4f9c4c18ffbe12cbe)
This commit is contained in:
Luke Faraone 2013-05-14 12:00:28 -07:00 committed by Leo Franchi
parent 6b8e9a738f
commit 6dc3ef5ea8
1 changed files with 6 additions and 3 deletions

View File

@ -159,8 +159,11 @@ function set_stream_property(stream_name, property, value) {
function stream_home_view_clicked(e) { function stream_home_view_clicked(e) {
var sub_row = $(e.target).closest('.subscription_row'); var sub_row = $(e.target).closest('.subscription_row');
var stream = sub_row.find('.subscription_name').text(); 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; sub.in_home_view = ! sub.in_home_view;
setTimeout(function () { setTimeout(function () {
@ -188,8 +191,8 @@ function stream_home_view_clicked(e) {
}, 0); }, 0);
exports.maybe_toggle_all_messages(); 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) { function stream_notifications_clicked(e) {
var sub_row = $(e.target).closest('.subscription_row'); var sub_row = $(e.target).closest('.subscription_row');