4,114
edits
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 1: | Line 1: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
var communityFeatured = $(' | var communityFeatured = $('#community-featured'); | ||
var filteredCards = $('.filtered-list-item'); | var filteredCards = $('.filtered-list-item'); | ||
var showArticleWrapper = $('#show-article-wrapper'); | var showArticleWrapper = $('#show-article-wrapper'); | ||
Line 12: | Line 12: | ||
// Insert the community featured element after the second card | // Insert the community featured element after the second card | ||
if (communityFeatured.length && filteredCards.length >= 2) { | |||
console.log("Community Featured element and at least two filtered cards found."); | |||
communityFeatured.detach(); | |||
filteredCards.eq(1).after(communityFeatured); | |||
communityFeatured.show(); | |||
console.log("Community Featured element has been moved after the second filtered card."); | |||
} else { | |||
if (!communityFeatured.length) { | |||
console.log("No Community Featured element found."); | |||
} | |||
if (filteredCards.length < 2) { | |||
console.log("Less than two filtered cards found. Found: ", filteredCards.length); | |||
} | |||
} | |||
// Check if the specific element exists on the page | // Check if the specific element exists on the page |