mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
Rename sort_narrow_list() to build_stream_list().
(imported from commit 533dbe4171b859077c496f656f8c2476107b318c)
This commit is contained in:
@@ -6,7 +6,7 @@ var last_private_message_count = 0;
|
|||||||
var last_mention_count = 0;
|
var last_mention_count = 0;
|
||||||
var previous_sort_order;
|
var previous_sort_order;
|
||||||
|
|
||||||
exports.sort_narrow_list = function () {
|
exports.build_stream_list = function () {
|
||||||
var streams = stream_data.subscribed_streams();
|
var streams = stream_data.subscribed_streams();
|
||||||
if (streams.length === 0) {
|
if (streams.length === 0) {
|
||||||
return;
|
return;
|
||||||
@@ -14,6 +14,7 @@ exports.sort_narrow_list = function () {
|
|||||||
|
|
||||||
var sort_recent = (streams.length > 40);
|
var sort_recent = (streams.length > 40);
|
||||||
|
|
||||||
|
|
||||||
streams.sort(function (a, b) {
|
streams.sort(function (a, b) {
|
||||||
if (sort_recent) {
|
if (sort_recent) {
|
||||||
if (recent_subjects.has(b) && ! recent_subjects.has(a)) {
|
if (recent_subjects.has(b) && ! recent_subjects.has(a)) {
|
||||||
@@ -237,7 +238,7 @@ function rebuild_recent_subjects(stream, active_topic) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.update_streams_sidebar = function () {
|
exports.update_streams_sidebar = function () {
|
||||||
exports.sort_narrow_list();
|
exports.build_stream_list();
|
||||||
|
|
||||||
if (! narrow.active()) {
|
if (! narrow.active()) {
|
||||||
return;
|
return;
|
||||||
@@ -324,7 +325,7 @@ exports.update_dom_with_unread_counts = function (counts) {
|
|||||||
|
|
||||||
exports.rename_stream = function (sub) {
|
exports.rename_stream = function (sub) {
|
||||||
sub.sidebar_li = build_narrow_filter(sub.name, "stream");
|
sub.sidebar_li = build_narrow_filter(sub.name, "stream");
|
||||||
exports.sort_narrow_list(); // big hammer
|
exports.build_stream_list(); // big hammer
|
||||||
};
|
};
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
@@ -386,7 +387,7 @@ $(function () {
|
|||||||
if (li) {
|
if (li) {
|
||||||
event.sub.sidebar_li = li;
|
event.sub.sidebar_li = li;
|
||||||
}
|
}
|
||||||
exports.sort_narrow_list();
|
exports.build_stream_list();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('subscription_remove_done.zulip', function (event) {
|
$(document).on('subscription_remove_done.zulip', function (event) {
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ function populate_subscriptions(subs, subscribed) {
|
|||||||
sub_rows.push(sub);
|
sub_rows.push(sub);
|
||||||
});
|
});
|
||||||
|
|
||||||
stream_list.sort_narrow_list();
|
stream_list.build_stream_list();
|
||||||
return sub_rows;
|
return sub_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user