Walking Pads günstig bei GONSER
document.addEventListener('DOMContentLoaded', function() {
const additionalFiltersButton = document.querySelector('.additionalFiltersButton');
if (additionalFiltersButton) {
additionalFiltersButton.classList.add('d-none'); // Hide the button initially
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes.length) {
const filterWrapper = document.querySelector('.findologic-filter-wrapper');
if (filterWrapper) {
if (filterWrapper.children.length > 1) {
additionalFiltersButton.classList.add('d-md-block');
} else {
additionalFiltersButton.classList.remove('d-md-block');
}
}
}
});
});
observer.observe(document.body, { childList: true, subtree: true });
}
const filterModal = document.getElementById('filterModal');
if (filterModal) {
const filterToggleButton = filterModal.querySelector('.filter-toggle.no-main-filters-filter-toggle');
if (filterToggleButton) {
filterToggleButton.innerHTML = `
Mehr Filter
`;
const filterCollapse = filterModal.querySelector('#filterCollapse');
if (filterCollapse) {
const pageContent = filterCollapse.querySelector('.page-content');
if (pageContent) {
const cardColumns = pageContent.querySelector('.card-columns');
if (cardColumns) {
const w100 = cardColumns.querySelector('.w-100');
if (w100 && w100.children.length > 0) {
filterToggleButton.classList.remove('d-none');
} else {
filterToggleButton.classList.add('d-none');
}
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes.length || mutation.removedNodes.length) {
if (w100.children.length > 0) {
filterToggleButton.classList.remove('d-none');
} else {
filterToggleButton.classList.add('d-none');
}
}
});
});
observer.observe(w100, { childList: true });
}
}
}
}
}
});