Jun 26 - Fix AI Analysis History delete icon

This commit is contained in:
2026-06-26 14:07:31 -04:00
parent 5b94858f7f
commit 6da29529a3
+12 -12
View File
@@ -473,18 +473,18 @@ if (IS_ADMIN) {
if (e.target.classList.contains('hist-cb')) _updateBulkBar(); if (e.target.classList.contains('hist-cb')) _updateBulkBar();
}); });
// Row delete icon — delegated // Row delete icon — direct listeners (delegated won't work: td stopPropagation swallows the event)
document.addEventListener('click', function(e) { document.querySelectorAll('.js-delete-row').forEach(function(btn) {
var btn = e.target.closest('.js-delete-row'); btn.addEventListener('click', function(e) {
if (!btn) return; e.stopPropagation();
e.stopPropagation(); var id = btn.dataset.id;
var id = btn.dataset.id; if (!confirm('Delete this analysis? This cannot be undone.')) return;
if (!confirm('Delete this analysis? This cannot be undone.')) return; _sendDeletes([id], function(ok) {
_sendDeletes([id], function(ok) { if (!ok) return;
if (!ok) return; var row = document.querySelector('.history-row[data-id="' + id + '"]');
var row = document.querySelector('.history-row[data-id="' + id + '"]'); if (row) row.remove();
if (row) row.remove(); _updateBulkBar();
_updateBulkBar(); });
}); });
}); });
} }