|
|
Line 123: |
Line 123: |
| } | | } |
|
| |
|
| function processEventCards() {
| | |
| $('.card.event').each(function() {
| |
| var existingContainer = $(this).find('.container-people-date');
| |
|
| |
| // If the container doesn't exist, create and append it
| |
| if (existingContainer.length === 0) {
| |
| existingContainer = $('<div class="container-people-date"></div>');
| |
| $(this).append(existingContainer); // Temporarily append to ensure it's in the DOM
| |
| }
| |
|
| |
| // Ensure the .people and .date elements are inside the container
| |
| var people = $(this).find('.people').detach();
| |
| var date = $(this).find('.date').detach();
| |
| existingContainer.append(people).append(date);
| |
|
| |
| // Decide where to place the container
| |
| if ($(this).closest('.home-chronicle-block').length) {
| |
| // Check if it's already correctly placed, if not, move it
| |
| if (!existingContainer.is($(this).find('.title').next())) {
| |
| $(this).find('.title').after(existingContainer);
| |
| }
| |
| } else if ($(this).closest('.home-chronicle-list').length) {
| |
| // Check if it's already correctly placed, if not, move it
| |
| if (!existingContainer.is($(this).find('.title').prev())) {
| |
| $(this).find('.title').before(existingContainer);
| |
| }
| |
| }
| |
| });
| |
| }
| |
|
| |
|
| if ($('#home').length > 0) { | | if ($('#home').length > 0) { |