| @@ -15,9 +15,12 @@ | ||
| 15 | 15 | init(); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | function init() { |
| 19 | - initFilterToggles(); | |
| 19 | + // Filter sidebar toggles (.yatra-filter-title click → toggle .open | |
| 20 | + // on the section) live in listing-filters.js. Keeping a second | |
| 21 | + // copy here meant TWO toggles fired per click, leaving the | |
| 22 | + // section in its original state — i.e. the arrow appeared dead. | |
| 20 | 23 | initViewToggle(); |
| 21 | 24 | initPriceRange(); |
| 22 | 25 | initAdvancedSearch(); |
| 23 | 26 | initTravelersSelect(); |
| @@ -152,25 +155,8 @@ | ||
| 152 | 155 | }); |
| 153 | 156 | |
| 154 | 157 | dropdown.addEventListener('click', function(e) { |
| 155 | 158 | e.stopPropagation(); |
| 156 | - }); | |
| 157 | - } | |
| 158 | - | |
| 159 | - // Filter section toggles | |
| 160 | - function initFilterToggles() { | |
| 161 | - const filterTitles = document.querySelectorAll('.yatra-filter-title'); | |
| 162 | - | |
| 163 | - filterTitles.forEach(title => { | |
| 164 | - title.addEventListener('click', function() { | |
| 165 | - const section = this.closest('.yatra-filter-section'); | |
| 166 | - section.classList.toggle('open'); | |
| 167 | - }); | |
| 168 | - }); | |
| 169 | - | |
| 170 | - // Open all filter sections by default | |
| 171 | - document.querySelectorAll('.yatra-filter-section').forEach(section => { | |
| 172 | - section.classList.add('open'); | |
| 173 | 159 | }); |
| 174 | 160 | } |
| 175 | 161 | |
| 176 | 162 | // View toggle (grid/list): one grid per page; localStorage key is per grid id (not global). |