mirror of
https://github.com/wilsonfreitas/awesome-quant.git
synced 2026-07-27 20:07:50 +00:00
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:
+12
-3
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user