feat(models): add alert and box models
Adds comprehensive data structures for Alert and Box functionality across models.
This commit is contained in:
16
static/js/account-alerts.js
Normal file
16
static/js/account-alerts.js
Normal file
@@ -0,0 +1,16 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const title = document.querySelector("[data-alert-detail-title]");
|
||||
const description = document.querySelector("[data-alert-detail-description]");
|
||||
const metadata = document.querySelector("[data-alert-detail-metadata]");
|
||||
|
||||
document.querySelectorAll("[data-alert-row]").forEach((row) => {
|
||||
row.addEventListener("click", (event) => {
|
||||
if (event.target.closest("button, input, a")) return;
|
||||
document.querySelectorAll("[data-alert-row].is-selected").forEach((item) => item.classList.remove("is-selected"));
|
||||
row.classList.add("is-selected");
|
||||
if (title) title.textContent = row.dataset.alertTitle || "";
|
||||
if (description) description.textContent = row.dataset.alertDescription || "";
|
||||
if (metadata) metadata.textContent = row.dataset.alertMetadata || "{}";
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user