mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
saved_snippets: Move "Saved snippets" button to compose control buttons.
This is follow-up of #31359 that moves "Saved snippets" button from "send_later" popover to message formatting buttons and adds support to use saved snippets in message-edit UI. Fixes #31830.
This commit is contained in:
@@ -37,6 +37,7 @@ export type Option = {
|
||||
|
||||
export type DropdownWidgetOptions = {
|
||||
widget_name: string;
|
||||
widget_selector?: string;
|
||||
// You can bold the selected `option` by setting `option.bold_current_selection` to `true`.
|
||||
// Currently, not implemented for stream names.
|
||||
get_options: (current_value: string | number | undefined) => Option[];
|
||||
@@ -103,7 +104,7 @@ export class DropdownWidget {
|
||||
|
||||
constructor(options: DropdownWidgetOptions) {
|
||||
this.widget_name = options.widget_name;
|
||||
this.widget_selector = `#${CSS.escape(this.widget_name)}_widget`;
|
||||
this.widget_selector = options.widget_selector ?? `#${CSS.escape(this.widget_name)}_widget`;
|
||||
// A widget wrapper may not exist based on the UI requirement.
|
||||
this.widget_wrapper_id = `${this.widget_selector}_wrapper`;
|
||||
this.widget_value_selector = `${this.widget_selector} .dropdown_widget_value`;
|
||||
|
||||
Reference in New Issue
Block a user