From 3c4fe97145dbc0e2b52d3cdee1f1913088351b48 Mon Sep 17 00:00:00 2001 From: Wilson Freitas Date: Sat, 28 Mar 2026 13:05:55 -0300 Subject: [PATCH] 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. --- site/static/main.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/site/static/main.js b/site/static/main.js index 65fbe0a..c59c966 100644 --- a/site/static/main.js +++ b/site/static/main.js @@ -128,8 +128,8 @@ applyFilters(); }); - // ===== Tag Click ===== - tableBody.addEventListener("click", (e) => { + // ===== Tag Click Handler ===== + function handleTagClick(e) { const tag = e.target.closest(".tag"); if (tag) { e.stopPropagation(); @@ -145,7 +145,16 @@ applyFilters(); 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 ===== tableBody.addEventListener("click", (e) => {