mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
confirm_dialog: Add post_render support in confirm_dialog.
This will be used by other modals when we will migrate those to use the same code as that of confirm_dialog.
This commit is contained in:
@@ -34,6 +34,9 @@ import * as settings_data from "./settings_data";
|
||||
This will show a loading spinner when the yes button is clicked.
|
||||
The caller is responsible for calling hide_dialog_spinner()
|
||||
to hide the spinner in both success and error handlers.
|
||||
|
||||
7) If a caller needs to run code after the modal body is added
|
||||
to DOM, it can do so by passing a post_render hook.
|
||||
*/
|
||||
|
||||
export function hide_dialog_spinner() {
|
||||
@@ -98,6 +101,10 @@ export function launch(conf) {
|
||||
|
||||
submit_button_span.html(conf.html_submit_button);
|
||||
|
||||
if (conf.post_render !== undefined) {
|
||||
conf.post_render();
|
||||
}
|
||||
|
||||
const submit_button = dialog.find(".dialog_submit_button");
|
||||
// Set up handlers.
|
||||
submit_button.on("click", () => {
|
||||
|
||||
Reference in New Issue
Block a user