mirror of https://github.com/zulip/zulip.git
invite_stream_picker: Don't rely on custom code in input_pill.
By using a custom `generate_pill_html`, we can remove the `has_stream` logic in `input_pill`, as part of a wider effort to remove custom pill logic in `input_pill`.
This commit is contained in:
parent
0d52ced27a
commit
ccbc569bab
|
@ -1,3 +1,5 @@
|
|||
import render_input_pill from "../templates/input_pill.hbs";
|
||||
|
||||
import * as input_pill from "./input_pill";
|
||||
import {set_up_stream} from "./pill_typeahead";
|
||||
import * as stream_data from "./stream_data";
|
||||
|
@ -49,6 +51,12 @@ export function create($stream_pill_container: JQuery): stream_pill.StreamPillWi
|
|||
$container: $stream_pill_container,
|
||||
create_item_from_text: create_item_from_stream_name,
|
||||
get_text_from_item: stream_pill.get_stream_name_from_item,
|
||||
generate_pill_html: (item) =>
|
||||
render_input_pill({
|
||||
...item,
|
||||
has_stream: true,
|
||||
display_value: stream_pill.get_display_string_from_item(item),
|
||||
}),
|
||||
});
|
||||
add_default_stream_pills(pill_widget);
|
||||
set_up_pill_typeahead({pill_widget, $pill_container: $stream_pill_container});
|
||||
|
|
Loading…
Reference in New Issue