Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

modals: Rename close_modal_active to close_active.

Aman Agrawal0c7184aaa090
diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.ts
index 23ec6ed9278..02a6c9d7744 100644
--- a/web/src/dialog_widget.ts
+++ b/web/src/dialog_widget.ts
@@ -22,7 +22,7 @@ import * as ui_report from "./ui_report";
* to avoid interference from other elements.
*
* 3) For settings, we have a click handler in settings.js
- * that will close the dialog via modals.close_active_modal.
+ * that will close the dialog via modals.close_active.
*
* 4) We assume that since this is a modal, you will
* only ever have one confirm dialog active at any
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index ed6e7d5141b..309a0ad11f0 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -281,7 +281,7 @@ export function process_escape_key(e) {
}
if (modals.is_open()) {
- modals.close_active_modal();
+ modals.close_active();
return true;
}
diff --git a/web/src/modals.ts b/web/src/modals.ts
index 4c298a7e8df..ffe6eb0d97a 100644
--- a/web/src/modals.ts
+++ b/web/src/modals.ts
@@ -90,7 +90,7 @@ export function open_modal(
return;
}
- close_active_modal();
+ close_active();
setTimeout(() => {
open_modal(modal_id, conf);
}, 10);
@@ -179,7 +179,7 @@ export function close_modal(modal_id: string, conf: Pick<ModalConfig, "on_hidden
}
if (!is_open()) {
- blueslip.warn("close_active_modal() called without checking is_open()");
+ blueslip.warn("close_active() called without checking is_open()");
return;
}
@@ -228,9 +228,9 @@ export function close_modal_if_open(modal_id: string): void {
}
}
-export function close_active_modal(): void {
+export function close_active(): void {
if (!is_open()) {
- blueslip.warn("close_active_modal() called without checking is_open()");
+ blueslip.warn("close_active() called without checking is_open()");
return;
}
diff --git a/web/src/portico/portico_modals.ts b/web/src/portico/portico_modals.ts
index eb4a6e5dba4..3314691aada 100644
--- a/web/src/portico/portico_modals.ts
+++ b/web/src/portico/portico_modals.ts
@@ -17,9 +17,9 @@ function active_modal(): string | undefined {
return `#${CSS.escape($micromodal.attr("id")!)}`;
}
-function close_active_modal(): void {
+function close_active(): void {
if (!is_open()) {
- blueslip.warn("close_active_modal() called without checking is_open()");
+ blueslip.warn("close_active() called without checking is_open()");
return;
}
@@ -62,7 +62,7 @@ export function open_modal(modal_id: string, recursive_call_count: number = 0):
return;
}
- close_active_modal();
+ close_active();
setTimeout(() => {
open_modal(modal_id, recursive_call_count);
}, 10);
@@ -119,7 +119,7 @@ export function close_modal(modal_id: string): void {
}
if (!is_open()) {
- blueslip.warn("close_active_modal() called without checking is_open()");
+ blueslip.warn("close_active() called without checking is_open()");
return;
}
diff --git a/web/src/settings.js b/web/src/settings.js
index f98c4b3ed0e..7cfa5c7596b 100644
--- a/web/src/settings.js
+++ b/web/src/settings.js
@@ -39,7 +39,7 @@ $(() => {
// event to the parent container otherwise the modal will not open. This
// is so because this event handler will get fired on any click in settings
// overlay and subsequently close any open modal.
- modals.close_active_modal();
+ modals.close_active();
});
});
diff --git a/web/src/settings_account.js b/web/src/settings_account.js
index 4a519d66921..cfdeac64c01 100644
--- a/web/src/settings_account.js
+++ b/web/src/settings_account.js
@@ -697,7 +697,7 @@ export function set_up() {
);
$("#user_deactivate_account_button").on("click", (e) => {
// This click event must not get propagated to parent container otherwise the modal
- // will not show up because of a call to `close_active_modal` in `settings.js`.
+ // will not show up because of a call to `close_active` in `settings.js`.
e.preventDefault();
e.stopPropagation();
diff --git a/web/src/settings_invites.ts b/web/src/settings_invites.ts
index 48a58ff8ce1..e25b3545fa0 100644
--- a/web/src/settings_invites.ts
+++ b/web/src/settings_invites.ts
@@ -236,7 +236,7 @@ export function on_load_success(
}
$(".admin_invites_table").on("click", ".revoke", (e) => {
// This click event must not get propagated to parent container otherwise the modal
- // will not show up because of a call to `close_active_modal` in `settings.js`.
+ // will not show up because of a call to `close_active` in `settings.js`.
e.preventDefault();
e.stopPropagation();
const $row = $(e.target).closest(".invite_row");
@@ -267,7 +267,7 @@ export function on_load_success(
$(".admin_invites_table").on("click", ".resend", (e) => {
// This click event must not get propagated to parent container otherwise the modal
- // will not show up because of a call to `close_active_modal` in `settings.js`.
+ // will not show up because of a call to `close_active` in `settings.js`.
e.preventDefault();
e.stopPropagation();
diff --git a/web/src/settings_users.js b/web/src/settings_users.js
index 7f624c254e1..083939f79aa 100644
--- a/web/src/settings_users.js
+++ b/web/src/settings_users.js
@@ -357,7 +357,7 @@ function start_data_load() {
function handle_deactivation($tbody) {
$tbody.on("click", ".deactivate", (e) => {
// This click event must not get propagated to parent container otherwise the modal
- // will not show up because of a call to `close_active_modal` in `settings.js`.
+ // will not show up because of a call to `close_active` in `settings.js`.
e.preventDefault();
e.stopPropagation();