import { refreshButtonPositions, refreshRangeIndicator } from '../../global/om-range-slider/athena-om-range-slider-refresh.js';
/**
 * Filter Dropdown
 *
 */
function filterDropdown() {
    let filterTitle = document.querySelectorAll('.athena-filter-title');
    filterTitle.forEach((element)=>{
        element.addEventListener('click', () => {
            element?.classList.toggle('athena-filter-title-active');
            element?.nextElementSibling?.classList.toggle('athena-filter-container-active');

            if(element.closest('.athena-search-filter').getAttribute('data-filter-type') === 'price') {
                refreshButtonPositions();
                refreshRangeIndicator();
            }
        });
    })
}

export {
    filterDropdown
}