4,554
edits
No edit summary Tag: Manual revert |
No edit summary Tag: Reverted |
||
Line 108: | Line 108: | ||
} | } | ||
function checkFiltersCleared(selector, communityElement, positionSelector, positionIndex) { | |||
var checkedFilters = $(selector + ' .filtered-value-option input[type="checkbox"]:checked'); | var checkedFilters = $(selector + ' .filtered-value-option input[type="checkbox"]:checked'); | ||
if (checkedFilters.length === 0) { | if (checkedFilters.length === 0) { | ||
positionAndShowCommunityElement(communityElement, positionSelector, positionIndex); | |||
} else { | } else { | ||
communityElement.hide(); | |||
communityElement.hide(); | |||
} | } | ||
} | } | ||
function positionAndShowCommunityElement(communityElement, positionSelector, positionIndex) { | |||
// Detach the element first | |||
communityElement.detach(); | |||
// Find the target position and insert the community element | |||
var targetPosition = $(positionSelector + ' .card').eq(positionIndex); | |||
communityElement.insertAfter(targetPosition); | |||
// Use fadeIn for a smooth appearance | |||
communityElement.hide().fadeIn(); | |||
} | |||
// Event delegation for filter changes in block view | // Event delegation for filter changes in block view |