4,408
edits
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
var listList = $('#list-list'); | var listList = $('#list-list'); | ||
var filteredListItems = $('#list .filtered-list-item'); // Selecting filtered-list-items in #list | var filteredListItems = $('#list .filtered-list-item'); // Selecting filtered-list-items in #list | ||
var listLists = [$('#list'), $('#list-list'), $('#list-list-1'), $('#list-list-2'), $('#list-list-3')]; // Store jQuery objects in an array | var listLists = [$('#list'), $('#list-list'), $('#list-list-1'), $('#list-list-2'), $('#list-list-3')]; // Store jQuery objects in an array | ||
var originalWidths = listLists.map(function(list) { | var originalWidths = listLists.map(function(list) { | ||
Line 186: | Line 184: | ||
showArticleWrapper.css('display', 'block'); | showArticleWrapper.css('display', 'block'); | ||
// Set new width using .each() to iterate over the jQuery objects | // Set new width using .each() to iterate over the jQuery objects | ||
$.each(listLists, function(index, list) { | $.each(listLists, function(index, list) { | ||
list.css('cssText', 'width: 60% !important;'); | list.css('cssText', 'width: 60% !important;'); | ||
}); | }); | ||
// Adjust width of filtered-list-items in #list | |||
filteredListItems.css('width', 'calc(33.3% - 0px)'); | |||
// Hide communityFeatured | // Hide communityFeatured | ||
Line 436: | Line 428: | ||
} | } | ||
} | } | ||
// closeModal function | // closeModal function | ||
function closeModal() { | function closeModal() { | ||
showArticleWrapper.hide(); | showArticleWrapper.hide(); | ||
// Revert width of filtered-list-items in listLists | // Revert width of filtered-list-items in listLists | ||
$.each(listLists, function(index, list) { | $.each(listLists, function(index, list) { | ||
list.width(originalWidths[index]); | list.width(originalWidths[index]); | ||
}); | }); | ||
// Revert width of filtered-list-items in #list | |||
filteredListItems.css('width', 'calc(20% - 0px)'); | |||
// Check if filters are cleared before showing the featured content | // Check if filters are cleared before showing the featured content | ||
Line 563: | Line 552: | ||
$('.list-view-on').hide(); // Hide the list-view-on | $('.list-view-on').hide(); // Hide the list-view-on | ||
}); | }); | ||
// Handle List View Button | // Handle List View Button | ||
$(".list-view-button").click(function() { | $(".list-view-button").click(function() { |