modal: Add support for event handler on closing a modal.

Part of implementing #20373.
This commit is contained in:
Ganesh Pawar
2022-01-27 12:35:35 +05:30
committed by Tim Abbott
parent 01335d7492
commit 73533e578a
2 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,4 @@
import $ from "jquery";
import Micromodal from "micromodal";
import render_dialog_widget from "../templates/dialog_widget.hbs";
@@ -59,8 +58,9 @@ export function show_dialog_spinner() {
loading.make_indicator(spinner);
}
export function close_modal() {
Micromodal.close("dialog_widget_modal");
// Supports a callback to be called once the modal finishes closing.
export function close_modal(on_hidden_callback) {
overlays.close_modal("dialog_widget_modal", {micromodal: true, on_hidden: on_hidden_callback});
}
export function launch(conf) {