fix: confirm deletes and restore recreated planning items

This commit is contained in:
2026-04-21 23:43:20 +02:00
parent 5b752ab7c4
commit 26bfa7fb64
4 changed files with 183 additions and 15 deletions
+12
View File
@@ -415,6 +415,17 @@ function mountThemeToggle() {
});
}
function mountDeleteConfirmations() {
document.querySelectorAll("[data-confirm-submit]").forEach((node) => {
node.addEventListener("click", (event) => {
const message = node.dataset.confirmSubmit || "Wirklich löschen?";
if (!window.confirm(message)) {
event.preventDefault();
}
});
});
}
document.addEventListener("DOMContentLoaded", async () => {
await registerServiceWorker();
injectCsrfTokens();
@@ -423,6 +434,7 @@ document.addEventListener("DOMContentLoaded", async () => {
mountDialogs();
mountPersonalSplitSync();
mountAnnualAmountSync();
mountDeleteConfirmations();
document.querySelectorAll("[data-enable-push]").forEach((node) => {
node.addEventListener("click", async (event) => {
event.preventDefault();