mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
Match full names in Streams autocomplete.
See #2137. When you add a person to a stream on the Streams page, the autocomplete will now match on the person's full name, not just their email. (imported from commit b250ea0dc61d54f7f2f330ef0616935d43234597)
This commit is contained in:
@@ -929,12 +929,13 @@ $(function () {
|
||||
return typeahead_helper.highlight_with_escaping(this.query, item_formatted);
|
||||
},
|
||||
matcher: function (item) {
|
||||
var query = $.trim(this.query);
|
||||
var query = $.trim(this.query.toLowerCase());
|
||||
if (query === '' || query === item.email) {
|
||||
return false;
|
||||
}
|
||||
// Case-insensitive.
|
||||
return (item.email.toLowerCase().indexOf(query.toLowerCase()) !== -1);
|
||||
return (item.email.toLowerCase().indexOf(query) !== -1) ||
|
||||
(item.full_name.toLowerCase().indexOf(query) !== -1);
|
||||
},
|
||||
sorter: typeahead_helper.sort_recipientbox_typeahead,
|
||||
updater: function (item) {
|
||||
|
||||
Reference in New Issue
Block a user