Add auto-save logic for notes field (onblur)
Deploy Bürgerwind / deploy (push) Successful in 16s Details

This commit is contained in:
Johannes Baumeister 2026-04-30 14:37:49 +02:00
parent 3172ee1939
commit 79a9262329
1 changed files with 22 additions and 0 deletions

22
app.js
View File

@ -1464,6 +1464,28 @@ document.addEventListener('DOMContentLoaded', async () => {
};
});
// NEU: Auto-Save für Notiz-Feld bei Verlassen (Blur)
document.querySelectorAll('.notiz-input').forEach(input => {
input.onblur = async (e) => {
const name = e.target.dataset.owner;
const notiz = e.target.value;
const sel = document.querySelector(`.status-select[data-owner="${name}"]`);
const status = sel ? sel.value : 'none';
state.ownerStatuses[name.toLowerCase()] = { status, notiz };
const data = owners[name];
if (data) {
await secureOwner(data.first, data.last, e.target, status, notiz);
}
};
// Enter-Taste triggert ebenfalls Speichern
input.onkeydown = (e) => {
if (e.key === 'Enter') e.target.blur();
};
});
// Add event listeners to secure buttons
document.querySelectorAll('.btn-secure').forEach(btn => {
btn.onclick = async (e) => {