Fix tag cloud filtering: add event listener to tag cloud tags

The tag cloud buttons were not triggering filters because the event
listener was only attached to the table body. Refactored tag click
handling into a shared function and added a separate listener for the
tag cloud outside the table.

Now clicking any tag (table or cloud) applies the filter correctly.
This commit is contained in:
Wilson Freitas
2026-03-28 13:05:55 -03:00
parent dc54c140e2
commit 3c4fe97145
+12 -3
View File
@@ -128,8 +128,8 @@
applyFilters(); applyFilters();
}); });
// ===== Tag Click ===== // ===== Tag Click Handler =====
tableBody.addEventListener("click", (e) => { function handleTagClick(e) {
const tag = e.target.closest(".tag"); const tag = e.target.closest(".tag");
if (tag) { if (tag) {
e.stopPropagation(); e.stopPropagation();
@@ -145,7 +145,16 @@
applyFilters(); applyFilters();
return; return;
} }
}); }
// Listen for tag clicks on table rows
tableBody.addEventListener("click", handleTagClick);
// Listen for tag clicks on tag cloud (outside table)
const tagCloud = $(".tag-cloud");
if (tagCloud) {
tagCloud.addEventListener("click", handleTagClick);
}
// ===== Row Expand ===== // ===== Row Expand =====
tableBody.addEventListener("click", (e) => { tableBody.addEventListener("click", (e) => {