diff --git a/templates/ai_summary.html b/templates/ai_summary.html index c52add7..2e97dd4 100644 --- a/templates/ai_summary.html +++ b/templates/ai_summary.html @@ -473,18 +473,18 @@ if (IS_ADMIN) { if (e.target.classList.contains('hist-cb')) _updateBulkBar(); }); - // Row delete icon — delegated - document.addEventListener('click', function(e) { - var btn = e.target.closest('.js-delete-row'); - if (!btn) return; - e.stopPropagation(); - var id = btn.dataset.id; - if (!confirm('Delete this analysis? This cannot be undone.')) return; - _sendDeletes([id], function(ok) { - if (!ok) return; - var row = document.querySelector('.history-row[data-id="' + id + '"]'); - if (row) row.remove(); - _updateBulkBar(); + // Row delete icon — direct listeners (delegated won't work: td stopPropagation swallows the event) + document.querySelectorAll('.js-delete-row').forEach(function(btn) { + btn.addEventListener('click', function(e) { + e.stopPropagation(); + var id = btn.dataset.id; + if (!confirm('Delete this analysis? This cannot be undone.')) return; + _sendDeletes([id], function(ok) { + if (!ok) return; + var row = document.querySelector('.history-row[data-id="' + id + '"]'); + if (row) row.remove(); + _updateBulkBar(); + }); }); }); }