mirror of https://github.com/zulip/zulip.git
Improve empty user filter handling for stream creates.
If we blank out the user filter for users (by hitting backspace, for example), then we now have short-circuit logic to display all the user checkboxes. (The user-facing behavior doesn't change here, but now we don't have to process all the strings.)
This commit is contained in:
parent
88870c316f
commit
5c091437da
|
@ -925,9 +925,16 @@ $(function () {
|
|||
}
|
||||
});
|
||||
|
||||
(function filter_user_checkboxes() {
|
||||
var user_labels = $("#user-checkboxes label.add-user-label");
|
||||
|
||||
if (search_term === '') {
|
||||
user_labels.css({display: 'block'});
|
||||
return;
|
||||
}
|
||||
|
||||
var users = people.get_rest_of_realm();
|
||||
var filtered_users = people.filter_people_by_search_terms(users, search_terms);
|
||||
var user_labels = $("#user-checkboxes label.add-user-label");
|
||||
|
||||
// Be careful about modifying the follow code. A naive implementation
|
||||
// will work very poorly with a large user population (~1000 users).
|
||||
|
@ -943,6 +950,7 @@ $(function () {
|
|||
var display = user_checked ? "block" : "none";
|
||||
elem.css({display: display});
|
||||
});
|
||||
}());
|
||||
|
||||
update_announce_stream_state();
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue