mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
Move sidebar click handlers into stream_list.js.
(imported from commit b284508b3abd2edc3fa4edf432307eee8f034b58)
This commit is contained in:
@@ -396,6 +396,39 @@ $(function () {
|
|||||||
// We need to make sure we resort if the removed sub gets added again
|
// We need to make sure we resort if the removed sub gets added again
|
||||||
previous_sort_order = undefined;
|
previous_sort_order = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#stream_filters').on('click', 'li .subscription_block', function (e) {
|
||||||
|
if (e.metaKey || e.ctrlKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ui.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();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#stream_filters').on('click', '.subject_box', function (e) {
|
||||||
|
if (e.metaKey || e.ctrlKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ui.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();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return exports;
|
return exports;
|
||||||
|
|||||||
@@ -1380,41 +1380,9 @@ $(function () {
|
|||||||
e.preventDefault();
|
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();
|
popovers.register_click_handlers();
|
||||||
notifications.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_stream_button').click(function (e) {
|
||||||
compose.start('stream');
|
compose.start('stream');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user