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();
});
// 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();
});
});
});
}