mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
stream_list: Factor out reset_to_unnarrowed helper.
This commit is contained in:
@@ -115,6 +115,15 @@ function remove_expanded_subjects() {
|
|||||||
$("ul.expanded_subjects").remove();
|
$("ul.expanded_subjects").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reset_to_unnarrowed(narrowed_within_same_stream) {
|
||||||
|
if (zoomed_to_topics && narrowed_within_same_stream !== true) {
|
||||||
|
zoom_out();
|
||||||
|
}
|
||||||
|
|
||||||
|
$("ul.filters li").removeClass('active-filter active-subject-filter');
|
||||||
|
remove_expanded_subjects();
|
||||||
|
}
|
||||||
|
|
||||||
function get_subject_filter_li(stream, subject) {
|
function get_subject_filter_li(stream, subject) {
|
||||||
var stream_li = get_filter_li('stream', stream);
|
var stream_li = get_filter_li('stream', stream);
|
||||||
return iterate_to_find(".expanded_subjects li.expanded_subject", subject, stream_li);
|
return iterate_to_find(".expanded_subjects li.expanded_subject", subject, stream_li);
|
||||||
@@ -400,12 +409,7 @@ exports.rename_stream = function (sub) {
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$(document).on('narrow_activated.zulip', function (event) {
|
$(document).on('narrow_activated.zulip', function (event) {
|
||||||
if (zoomed_to_topics && (active_stream_name() !== zoomed_stream)) {
|
reset_to_unnarrowed(active_stream_name() === zoomed_stream);
|
||||||
zoom_out();
|
|
||||||
}
|
|
||||||
|
|
||||||
$("ul.filters li").removeClass('active-filter active-subject-filter');
|
|
||||||
remove_expanded_subjects();
|
|
||||||
|
|
||||||
// TODO: handle confused filters like "in:all stream:foo"
|
// TODO: handle confused filters like "in:all stream:foo"
|
||||||
var op_in = event.filter.operands('in');
|
var op_in = event.filter.operands('in');
|
||||||
@@ -440,11 +444,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('narrow_deactivated.zulip', function (event) {
|
$(document).on('narrow_deactivated.zulip', function (event) {
|
||||||
if (zoomed_to_topics) {
|
reset_to_unnarrowed();
|
||||||
zoom_out();
|
|
||||||
}
|
|
||||||
$("ul.filters li").removeClass('active-filter active-subject-filter');
|
|
||||||
remove_expanded_subjects();
|
|
||||||
$("#global_filters li[data-name='home']").addClass('active-filter');
|
$("#global_filters li[data-name='home']").addClass('active-filter');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user