Files
CTFd/assets/js/utils/notifications/alerts.js
Kevin Chung a64e7d51ef Squashed 'CTFd/themes/core-beta/' changes from 9126d77d..5ce3003b
5ce3003b Merge pull request #47 from aCursedComrade/patch-1
c9887cb1 Fix team template

git-subtree-dir: CTFd/themes/core-beta
git-subtree-split: 5ce3003b4d68352e629ee2d390bc999e7d6b071e
2023-06-11 15:56:28 -04:00

24 lines
630 B
JavaScript

import Alpine from "alpinejs";
import { Modal } from "bootstrap";
import CTFd from "../../index";
export default () => {
Alpine.store("modal", { title: "", html: "" });
CTFd._functions.events.eventAlert = data => {
Alpine.store("modal", data);
let modal = new Modal(document.querySelector("[x-ref='modal']"));
// TODO: Get rid of this private attribute access
// See https://github.com/twbs/bootstrap/issues/31266
modal._element.addEventListener(
"hidden.bs.modal",
event => {
CTFd._functions.events.eventRead(data.id);
},
{ once: true }
);
modal.show();
};
};