mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
dialog_widget: Add support for having a custom id on the container element.
This commit is contained in:
@@ -78,6 +78,7 @@ export function launch(conf) {
|
|||||||
// * close_on_submit: Whether to close modal on clicking submit.
|
// * close_on_submit: Whether to close modal on clicking submit.
|
||||||
// * focus_submit_on_open: Whether to focus submit button on open.
|
// * focus_submit_on_open: Whether to focus submit button on open.
|
||||||
// * help_link: A help link in the heading area.
|
// * help_link: A help link in the heading area.
|
||||||
|
// * id: Custom id to the container element to modify styles.
|
||||||
|
|
||||||
for (const f of mandatory_fields) {
|
for (const f of mandatory_fields) {
|
||||||
if (conf[f] === undefined) {
|
if (conf[f] === undefined) {
|
||||||
@@ -97,6 +98,7 @@ export function launch(conf) {
|
|||||||
link: conf.help_link,
|
link: conf.help_link,
|
||||||
html_submit_button,
|
html_submit_button,
|
||||||
html_body: conf.html_body,
|
html_body: conf.html_body,
|
||||||
|
id: conf.id,
|
||||||
});
|
});
|
||||||
const dialog = $(html);
|
const dialog = $(html);
|
||||||
$("body").append(dialog);
|
$("body").append(dialog);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="micromodal" id="dialog_widget_modal" aria-hidden="true">
|
<div class="micromodal" id="dialog_widget_modal" aria-hidden="true">
|
||||||
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
|
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
|
||||||
<div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="dialog_title">
|
<div {{#if id}}id="{{id}}" {{/if}}class="modal__container" role="dialog" aria-modal="true" aria-labelledby="dialog_title">
|
||||||
<header class="modal__header">
|
<header class="modal__header">
|
||||||
<h1 class="modal__title dialog_heading">
|
<h1 class="modal__title dialog_heading">
|
||||||
{{{ heading_text }}}
|
{{{ heading_text }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user