mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
We extract a general purpose widget to create dropdown lists with
search. This widget is used for default code block language, but can
be easily extended to cover notifications_stream and similar options.
The current usage is:
```js
const widget = DropdownListWidget({
setting_name: 'realm_alpha_beta',
data: [{name: 'hello', value: 'world'}, {...}, ...],
subsection: 'msg-editing',
default_text: 'Nothing is selected',
});
```
and
```handlebars
{{> dropdown_list_widget
setting_name="realm_alpha_beta"
list_placeholder=(t 'Filter the data')
reset_button_text=(t '[Unset]')
label=admin_settings_label.realm_alpha_beta }}
```
This can further be refined by shifting more variables from handlebars
to javascript in the future.
|
||
|---|---|---|
| .. | ||
| assets | ||
| audio | ||
| generated | ||
| html | ||
| images | ||
| js | ||
| shared | ||
| styles | ||
| templates | ||
| third | ||
| .eslintrc.json | ||
| .gitignore | ||
| favicon.ico | ||