|
|
Line 423: |
Line 423: |
| // End of openModal | | // End of openModal |
| } | | } |
|
| |
| // Function to check if all filters are cleared in block view and its variations
| |
| function checkBlockFiltersCleared() {
| |
| var selectors = ['#list', '#list-block-1', '#list-block-2', '#list-block-3'];
| |
| for (var i = 0; i < selectors.length; i++) {
| |
| var selector = selectors[i];
| |
| var checkedFilters = $(selector + ' .filtered-value-option input[type="checkbox"]:checked');
| |
| console.log('Checked filters count in ' + selector + ':', checkedFilters.length);
| |
|
| |
| if (checkedFilters.length === 0) {
| |
| console.log('All filters are cleared in ' + selector);
| |
| // Show all community elements related to block views
| |
| $('#community-featured, #community-featured-block-1, #community-featured-block-2, #community-featured-block-3').show();
| |
| } else {
| |
| console.log('Some filters are still active in ' + selector);
| |
| // Hide all community elements related to block views
| |
| $('#community-featured, #community-featured-block-1, #community-featured-block-2, #community-featured-block-3').hide();
| |
| }
| |
| }
| |
| }
| |
|
| |
| // Function to check if all filters are cleared in list view and its variations
| |
| function checkListFiltersCleared() {
| |
| var selectors = ['#list-list', '#list-list-1', '#list-list-2', '#list-list-3'];
| |
| for (var i = 0; i < selectors.length; i++) {
| |
| var selector = selectors[i];
| |
| var checkedFilters = $(selector + ' .filtered-value-option input[type="checkbox"]:checked');
| |
| console.log('Checked filters count in ' + selector + ':', checkedFilters.length);
| |
|
| |
| if (checkedFilters.length === 0) {
| |
| console.log('All filters are cleared in ' + selector);
| |
| // Show all community elements related to list views
| |
| $('#community-featured, #community-featured-list-1, #community-featured-list-2, #community-featured-list-3').show();
| |
| } else {
| |
| console.log('Some filters are still active in ' + selector);
| |
| // Hide all community elements related to list views
| |
| $('#community-featured, #community-featured-list-1, #community-featured-list-2, #community-featured-list-3').hide();
| |
| }
| |
| }
| |
| }
| |
|
| |
|
| // closeModal function | | // closeModal function |
Line 476: |
Line 436: |
| | | |
| // Check if filters are cleared before showing the featured content | | // Check if filters are cleared before showing the featured content |
| checkBlockFiltersCleared(); | | updateCommunityElementsVisibility(); |
| checkListFiltersCleared();
| |
| } | | } |
|
| |
|