()
| 138 | } |
| 139 | |
| 140 | function syncFilters() { |
| 141 | const bar = document.getElementById('filters'); |
| 142 | for (const button of bar.querySelectorAll('button.range')) { |
| 143 | const selected = String(state.preset) === button.dataset.days; |
| 144 | button.classList.toggle('is-selected', selected); |
| 145 | button.setAttribute('aria-pressed', String(selected)); |
| 146 | } |
| 147 | const { from, to } = currentRange(); |
| 148 | $(bar, 'custom-from').value = from; |
| 149 | $(bar, 'custom-to').value = to; |
| 150 | } |
| 151 | |
| 152 | function setRangeSummary(text) { |
| 153 | document.getElementById('range-summary').textContent = text; |
no test coverage detected