4,554
edits
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 119: | Line 119: | ||
function positionAndShowCommunityElement(communityElement, positionSelector, positionIndex) { | function positionAndShowCommunityElement(communityElement, positionSelector, positionIndex) { | ||
communityElement.detach(); | communityElement.detach(); | ||
var targetPosition = $(positionSelector + ' . | var targetPosition = $(positionSelector + ' .filtered-list-item').eq(positionIndex); | ||
if(targetPosition.length === 0) { | if(targetPosition.length === 0) { | ||
console.log("Target position not found. Selector or index might be incorrect."); | console.log("Target position not found. Selector or index might be incorrect."); | ||
Line 133: | Line 132: | ||
console.log("Community element should now be visible after", targetPosition); | console.log("Community element should now be visible after", targetPosition); | ||
} | } | ||
// Event delegation for filter changes in block view | // Event delegation for filter changes in block view | ||
$('#list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | $('#list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | ||
checkFiltersCleared('#list', communityFeatured); // | checkFiltersCleared('#list', communityFeatured, '#list', 1); // Position after 2nd filtered card | ||
}); | }); | ||
// Event delegation for filter changes in list view | // Event delegation for filter changes in list view | ||
$('#list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | $('#list-list').on('change', '.filtered-value-option input[type="checkbox"]', function() { | ||
checkFiltersCleared('#list-list', communityListFeatured); // | checkFiltersCleared('#list-list', communityListFeatured, '#list-list', 3); // Position after 4th filtered card | ||
}); | }); | ||