Move sidebar click handlers into stream_list.js.

(imported from commit b284508b3abd2edc3fa4edf432307eee8f034b58)
This commit is contained in:
Steve Howell
2013-11-22 16:25:31 -05:00
parent 60a8e6e769
commit 1080b4239d
2 changed files with 33 additions and 32 deletions

View File

@@ -1380,41 +1380,9 @@ $(function () {
e.preventDefault();
});
$('#stream_filters').on('click', 'li .subscription_block', function (e) {
if (e.metaKey || e.ctrlKey) {
return;
}
if (exports.home_tab_obscured()) {
ui.change_tab_to('#home');
}
var stream = $(e.target).parents('li').attr('data-name');
narrow.by('stream', stream, {select_first_unread: true, trigger: 'sidebar'});
e.preventDefault();
e.stopPropagation();
});
popovers.register_click_handlers();
notifications.register_click_handlers();
$('#stream_filters').on('click', '.subject_box', function (e) {
if (e.metaKey || e.ctrlKey) {
return;
}
if (exports.home_tab_obscured()) {
ui.change_tab_to('#home');
}
var stream = $(e.target).parents('ul').attr('data-stream');
var subject = $(e.target).parents('li').attr('data-name');
narrow.activate([['stream', stream],
['topic', subject]],
{select_first_unread: true, trigger: 'sidebar'});
e.preventDefault();
});
$('.compose_stream_button').click(function (e) {
compose.start('stream');
});