Add auto-save logic for notes field (onblur)
Deploy Bürgerwind / deploy (push) Successful in 16s
Details
Deploy Bürgerwind / deploy (push) Successful in 16s
Details
This commit is contained in:
parent
3172ee1939
commit
79a9262329
22
app.js
22
app.js
|
|
@ -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
|
// Add event listeners to secure buttons
|
||||||
document.querySelectorAll('.btn-secure').forEach(btn => {
|
document.querySelectorAll('.btn-secure').forEach(btn => {
|
||||||
btn.onclick = async (e) => {
|
btn.onclick = async (e) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue