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:
sahil839 2021-07-05 22:18:04 +05:30 committed by Tim Abbott
parent c87c4f92ee
commit 71969f5196
1 changed files with 7 additions and 0 deletions

View File

@ -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", () => {