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.

js: Make alert_popup shared.

PIG2087b60ce1d70b0
diff --git a/static/js/alert_popup.ts b/static/js/alert_popup.ts
index 8425350b87a..bac1718b30c 100644
--- a/static/js/alert_popup.ts
+++ b/static/js/alert_popup.ts
@@ -1,16 +1,14 @@
import $ from "jquery";
-export function initialize(): void {
- // this will hide the alerts that you click "x" on.
- $("body").on("click", ".alert-box > div .exit", function () {
- const $alert = $(this).closest(".alert-box > div");
- $alert.addClass("fade-out");
- setTimeout(() => {
- $alert.removeClass("fade-out show");
- }, 300);
- });
+// this will hide the alerts that you click "x" on.
+$("body").on("click", ".alert-box > div .exit", function () {
+ const $alert = $(this).closest(".alert-box > div");
+ $alert.addClass("fade-out");
+ setTimeout(() => {
+ $alert.removeClass("fade-out show");
+ }, 300);
+});
- $(".alert-box").on("click", ".stackframe", function () {
- $(this).siblings(".code-context").toggle("fast");
- });
-}
+$(".alert-box").on("click", ".stackframe", function () {
+ $(this).siblings(".code-context").toggle("fast");
+});
diff --git a/static/js/bundles/common.js b/static/js/bundles/common.js
index 527282ecb1c..b500ba0bf50 100644
--- a/static/js/bundles/common.js
+++ b/static/js/bundles/common.js
@@ -3,6 +3,7 @@ import "core-js/features/symbol";
import "css.escape";
import "../webpack_public_path";
import "../../../tools/debug-require";
+import "../alert_popup";
import "../csrf";
import "../blueslip";
import "../../third/bootstrap/js/bootstrap";
diff --git a/static/js/ui_init.js b/static/js/ui_init.js
index 28149a8c7cc..e25ffffa82a 100644
--- a/static/js/ui_init.js
+++ b/static/js/ui_init.js
@@ -8,7 +8,6 @@ import * as fenced_code from "../shared/js/fenced_code";
import render_edit_content_button from "../templates/edit_content_button.hbs";
import * as activity from "./activity";
-import * as alert_popup from "./alert_popup";
import * as alert_words from "./alert_words";
import * as blueslip from "./blueslip";
import * as bot_data from "./bot_data";
@@ -465,7 +464,6 @@ export function initialize_everything() {
// template.
compose.initialize();
message_lists.initialize();
- alert_popup.initialize();
alert_words.initialize(alert_words_params);
emojisets.initialize();
people.initialize(page_params.user_id, people_params);