4,092
edits
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
var list = $('#list'); | var list = $('#list'); | ||
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 originalListWidth = list.width(); // Store the original width for #list | var originalListWidth = list.width(); // Store the original width for #list | ||
var originalListListWidth = listList.width(); // Store the original width for #list-list | var originalListListWidth = listList.width(); // Store the original width for #list-list | ||
// Store jQuery objects in an array | |||
var listLists = [$('#list-list-1'), $('#list-list-2'), $('#list-list-3')]; | |||
// Store original widths in an array | |||
var originalWidths = listLists.map(function(list) { | |||
return list.width(); | |||
}); | |||
// Initial check to set the visibility based on the current state of filters | // Initial check to set the visibility based on the current state of filters | ||
Line 175: | Line 175: | ||
filteredListItems.css('width', 'calc(33.15% - 0px)'); | filteredListItems.css('width', 'calc(33.15% - 0px)'); | ||
// | // Set new width using .each() to iterate over the jQuery objects | ||
$.each(listLists, function(index, list) { | |||
list.css('cssText', 'width: 60% !important;'); | |||
}); | |||
// Hide communityFeatured | // Hide communityFeatured | ||
Line 428: | Line 428: | ||
filteredListItems.css('width', 'calc(20% - 0px)'); | filteredListItems.css('width', 'calc(20% - 0px)'); | ||
// Revert width of filtered-list-items in | // Revert width of filtered-list-items in listLists | ||
$.each(listLists, function(index, list) { | |||
list.width(originalWidths[index]); | |||
}); | |||
// Check if filters are cleared before showing the featured content | // Check if filters are cleared before showing the featured content |