4,143
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 125: | Line 125: | ||
function processEventCards() { | function processEventCards() { | ||
$('.card.event').each(function() { | $('.card.event').each(function() { | ||
var | var $card = $(this); | ||
var existingContainer = $card.find('.container-people-date'); | |||
// | |||
// Create container if missing | |||
if (existingContainer.length === 0) { | if (existingContainer.length === 0) { | ||
existingContainer = $('<div class="container-people-date"></div>'); | existingContainer = $('<div class="container-people-date"></div>'); | ||
$ | $card.append(existingContainer); // temp placement | ||
} | } | ||
// | // Detach people and date | ||
var people = $ | var people = $card.find('.people').detach(); | ||
var date = $ | var date = $card.find('.date').detach(); | ||
// BLOCK VIEW (gallery) | |||
// | if ($card.closest('.home-chronicle-block').length) { | ||
if ($ | existingContainer.append(people).append(date); | ||
// Place container after title | |||
if (!existingContainer.is($card.find('.title').next())) { | |||
$card.find('.title').after(existingContainer); | |||
// | |||
if (!existingContainer.is($ | |||
$ | |||
} | } | ||
// LIST VIEW | |||
} else if ($card.closest('.home-chronicle-list').length) { | |||
// Only append .people into container | |||
existingContainer.empty().append(people); | |||
// Place container before title | |||
$card.find('.title').before(existingContainer); | |||
// Place date after title | |||
$card.find('.title').after(date); | |||
} | } | ||
}); | }); |