Initial commit: InviteMe production redesign
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
document.querySelectorAll("form[data-confirm]").forEach(form => {
|
||||
form.addEventListener("submit", event => {
|
||||
if (!window.confirm(form.dataset.confirm)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll("select[data-auto-submit]").forEach(select => {
|
||||
select.addEventListener("change", () => select.form.submit());
|
||||
});
|
||||
|
||||
document.querySelectorAll("[data-sidebar-toggle]").forEach(button => {
|
||||
button.addEventListener("click", () => document.body.classList.toggle("sidebar-open"));
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", event => {
|
||||
if (event.key === "Escape") document.body.classList.remove("sidebar-open");
|
||||
});
|
||||
Reference in New Issue
Block a user