mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 10:33:54 +00:00
js: Make alert_popup shared.
It allows the click handler for the "x" button, and the stacktrace toggler to be shared between webapp and the portico pages. Reimplements #17801.
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user