4,554
edits
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
var communityFeatured = $('#community-featured'); | var communityFeatured = $('#community-featured'); | ||
var communityListFeatured = $('#community-list-featured'); | |||
var cards = $('.card'); | var cards = $('.card'); | ||
var filteredCards = $('.filtered-list-item'); | var filteredCards = $('.filtered-list-item'); | ||
Line 20: | Line 21: | ||
formatCommunityCardDescriptions(); | formatCommunityCardDescriptions(); | ||
} | } | ||
if (communityListFeatured.length && filteredCards.length >= 2) { | |||
// Detach and insert the community featured element after the second card | |||
communityListFeatured.detach(); | |||
filteredCards.eq(1).after(communityListFeatured); | |||
// Show the community-featured element after positioning it | |||
communityListFeatured.show(); | |||
} | |||
function formatParagraphs(text) { | function formatParagraphs(text) { | ||
var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); |