early version: modular block files, full template set, tab UI, OpenGL defaults
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// ── Error modal ───────────────────────────────────────────────────────────────
|
||||
//
|
||||
// A simple overlay modal that displays -ACK! with a custom message.
|
||||
// Depends on: dom.js ($)
|
||||
//
|
||||
|
||||
/**
|
||||
* Shows the error modal with the given message.
|
||||
* The overlay is absolutely positioned and blocks all interaction until dismissed.
|
||||
* @param {string} msg - message to display inside the error box
|
||||
*/
|
||||
function showError(msg) {
|
||||
const el = $("#error-overlay");
|
||||
el.querySelector(".error-msg").textContent = msg;
|
||||
el.classList.add("active");
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the error modal. Triggered by clicking the × button,
|
||||
* the overlay backdrop, or called programmatically.
|
||||
* @param {MouseEvent} [ev] - event to check target matching
|
||||
*/
|
||||
function closeError(ev) {
|
||||
if (
|
||||
!ev ||
|
||||
ev.target === ev.currentTarget ||
|
||||
ev.target.classList.contains("error-close")
|
||||
) {
|
||||
$("#error-overlay").classList.remove("active");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user