()
| 161 | } |
| 162 | |
| 163 | function syncFilters() { |
| 164 | const bar = document.getElementById('filters'); |
| 165 | for (const button of bar.querySelectorAll('button.range')) { |
| 166 | const selected = String(state.preset) === button.dataset.days; |
| 167 | button.classList.toggle('is-selected', selected); |
| 168 | button.setAttribute('aria-pressed', String(selected)); |
| 169 | } |
| 170 | const { from, to } = currentRange(); |
| 171 | $(bar, 'custom-from').value = from; |
| 172 | $(bar, 'custom-to').value = to; |
| 173 | } |
| 174 | |
| 175 | function setRangeSummary(text) { |
| 176 | document.getElementById('range-summary').textContent = text; |
no test coverage detected