signup: Use portico_modals module to handle modal on signup page.

This does not results in any behavioral or UI change, we just
use portico_modals module to open and close the modal instead
of directly calling functions like Micromodal.open and
Micromodal.close. This change also solves a bug where the
modal was not closed previously on clicking anywhere outside
the modal.
This commit is contained in:
Sahil Batra 2023-10-04 17:49:57 +05:30 committed by Tim Abbott
parent 2df26f3d27
commit f88715cb2c
1 changed files with 4 additions and 6 deletions

View File

@ -1,11 +1,12 @@
import $ from "jquery";
import Micromodal from "micromodal";
import * as common from "../common";
import {$t} from "../i18n";
import {password_quality, password_warning} from "../password_quality";
import * as settings_config from "../settings_config";
import * as portico_modals from "./portico_modals";
$(() => {
// NB: this file is included on multiple pages. In each context,
// some of the jQuery selectors below will return empty lists.
@ -233,10 +234,7 @@ $(() => {
});
$("#new-user-email-address-visibility .change_email_address_visibility").on("click", () => {
Micromodal.show("change-email-address-visibility-modal", {
disableFocus: true,
openClass: "modal--opening",
});
portico_modals.open_modal("change-email-address-visibility-modal");
});
$("#change-email-address-visibility-modal .dialog_submit_button").on("click", () => {
@ -245,7 +243,7 @@ $(() => {
10,
);
$("#email_address_visibility").val(selected_val);
Micromodal.close("change-email-address-visibility-modal");
portico_modals.close_modal("change-email-address-visibility-modal");
let selected_option_text;