minor: Specify types of pills while initializing pill typeahead.

In options that we pass to pill_typeahead.set_up we
specify if we want typeahead to support stream or
user_group pills, and use users as source by default.

Using users for source by default, can have unnecessary
suggestions in typeaheads where only user_groups or streams
are needed.

So to solve that, we specify if we want users pill in the input.
This is then utilized in further commits, to clean up hacky code
that deals with intializing source for typeahead.
This commit is contained in:
m-e-l-u-h-a-n
2021-05-25 13:41:21 +05:30
committed by Tim Abbott
parent 637f648828
commit 0080daa5a3
5 changed files with 91 additions and 4 deletions

View File

@@ -275,7 +275,7 @@ export function populate_user_groups() {
const input = pill_container.children(".input");
if (can_edit(data.id)) {
const opts = {update_func: update_cancel_button};
const opts = {update_func: update_cancel_button, user: true};
pill_typeahead.set_up(input, pills, opts);
}