mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
dialog_widget: Add support for rendering a single footer button.
This commit is contained in:
@@ -79,6 +79,7 @@ export function launch(conf) {
|
|||||||
// * 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.
|
// * id: Custom id to the container element to modify styles.
|
||||||
|
// * single_footer_button: If true, don't include the "Cancel" button.
|
||||||
|
|
||||||
for (const f of mandatory_fields) {
|
for (const f of mandatory_fields) {
|
||||||
if (conf[f] === undefined) {
|
if (conf[f] === undefined) {
|
||||||
@@ -99,6 +100,7 @@ export function launch(conf) {
|
|||||||
html_submit_button,
|
html_submit_button,
|
||||||
html_body: conf.html_body,
|
html_body: conf.html_body,
|
||||||
id: conf.id,
|
id: conf.id,
|
||||||
|
single_footer_button: conf.single_footer_button,
|
||||||
});
|
});
|
||||||
const dialog = $(html);
|
const dialog = $(html);
|
||||||
$("body").append(dialog);
|
$("body").append(dialog);
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
{{{ html_body }}}
|
{{{ html_body }}}
|
||||||
</main>
|
</main>
|
||||||
<footer class="modal__footer">
|
<footer class="modal__footer">
|
||||||
|
{{#unless single_footer_button}}
|
||||||
<button class="modal__btn dialog_cancel_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{t "Cancel" }}</button>
|
<button class="modal__btn dialog_cancel_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{t "Cancel" }}</button>
|
||||||
<button class="modal__btn dialog_submit_button">
|
{{/unless}}
|
||||||
|
<button class="modal__btn dialog_submit_button"{{#if single_footer_button}} aria-label="{{t 'Close this dialog window' }}" data-micromodal-close{{/if}}>
|
||||||
<span>{{{ html_submit_button }}}</span>
|
<span>{{{ html_submit_button }}}</span>
|
||||||
<div class="modal__spinner"></div>
|
<div class="modal__spinner"></div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user