feat: implement tabbed category filtering for content list page
This commit is contained in:
parent
92783eb1b7
commit
5ee5bf85e4
@ -83,7 +83,16 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
visibleCount++;
|
visibleCount++;
|
||||||
} else {
|
} else {
|
||||||
const cardCategory = cardDiv.getAttribute('data-category'); // Get category from the .card div
|
const cardCategory = cardDiv.getAttribute('data-category'); // Get category from the .card div
|
||||||
console.log('Card element:', cardLinkElement, 'Card div:', cardDiv, 'Card category:', cardCategory, 'Selected:', selectedCategory);
|
|
||||||
|
// Detailed log for comparison
|
||||||
|
const sCat = selectedCategory ? selectedCategory : 'null_or_empty';
|
||||||
|
const cCat = cardCategory ? cardCategory : 'null_or_empty';
|
||||||
|
console.log(
|
||||||
|
`Comparing: cardCategory='${cCat}' (length ${cCat.length})` +
|
||||||
|
` vs selectedCategory='${sCat}' (length ${sCat.length})` +
|
||||||
|
` for card titled: '${cardDiv.querySelector('.card-title') ? cardDiv.querySelector('.card-title').textContent.trim() : 'N/A'}'`
|
||||||
|
);
|
||||||
|
|
||||||
const isVisible = (cardCategory === selectedCategory);
|
const isVisible = (cardCategory === selectedCategory);
|
||||||
cardLinkElement.style.display = isVisible ? '' : 'none';
|
cardLinkElement.style.display = isVisible ? '' : 'none';
|
||||||
if (isVisible) visibleCount++;
|
if (isVisible) visibleCount++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user