diff --git a/docker/index.html b/docker/index.html index fc3cc97..c8619e3 100644 --- a/docker/index.html +++ b/docker/index.html @@ -2913,85 +2913,6 @@ button:active, .btn:active, .meal-card-main:active, .dagboek-item:active, .food- }); }); - // === Unified meal-group action delegation === - listEl.addEventListener('click', (e) => { - const btn = e.target.closest('[data-action]'); - if (!btn) return; - const action = btn.dataset.action; - const momentId = btn.dataset.moment; - const entryIdx = btn.dataset.entry != null ? parseInt(btn.dataset.entry) : null; - - if (action === 'toggle-meal') { - const group = btn.closest('.eetmoment-meal-group'); - if (!group) return; - const wrap = group.querySelector('.eetmoment-meal-items-wrap'); - const actions = group.querySelector('.eetmoment-meal-actions'); - if (wrap) { - wrap.classList.toggle('hidden'); - if (actions) actions.classList.toggle('hidden'); - const arrow = btn.querySelector('span:last-child i'); - if (arrow) { - arrow.className = wrap.classList.contains('hidden') ? 'fas fa-chevron-down' : 'fas fa-chevron-up'; - } - } - } - else if (action === 'edit-porties') { - showBulkPortieEdit(activeDate, momentId, entryIdx); - } - else if (action === 'delete-meal') { - const dayData = getOrCreateDay(activeDate); - const entry = (dayData[momentId] || [])[entryIdx]; - const mealName = (entry && entry.mealNaam) || 'maaltijd'; - showConfirmModal('Maaltijd verwijderen', - 'Deze hele maaltijd verwijderen uit je dagboek?', - () => { - dayData[momentId].splice(entryIdx, 1); - saveDagboek(); - renderDagboek(); - }); - } - else if (action === 'move-meal') { - const overlay = document.createElement('div'); - overlay.className = 'modal-overlay'; - overlay.style.zIndex = '500'; - const options = EETMOMENTEN.map(m => - `` - ).join(''); - overlay.innerHTML = ` -