MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 119: Line 119:


function positionAndShowCommunityElement(communityElement, positionSelector, positionIndex) {
function positionAndShowCommunityElement(communityElement, positionSelector, positionIndex) {
    // Detach the element first
    console.log("Positioning community element");
    communityElement.detach();
    communityElement.detach();
    // Find the target position and insert the community element
    var targetPosition = $(positionSelector + ' .card').eq(positionIndex);
    var targetPosition = $(positionSelector + ' .card').eq(positionIndex);
    if(targetPosition.length === 0) {
        console.log("Target position not found. Selector or index might be incorrect.");
        return;
    }
    communityElement.insertAfter(targetPosition);
    communityElement.insertAfter(targetPosition);
    communityElement.hide().fadeIn();
    // Use fadeIn for a smooth appearance
    console.log("Community element should now be visible after", targetPosition);
    communityElement.hide().fadeIn();
}
}
// Event delegation for filter changes in block view
// Event delegation for filter changes in block view

Navigation menu