(container)
| 45 | } |
| 46 | |
| 47 | function syncContainer(container) { |
| 48 | container.querySelectorAll('.mdbook-tab').forEach(function (tab) { |
| 49 | const isActive = tab.classList.contains('active'); |
| 50 | tab.setAttribute('aria-selected', isActive ? 'true' : 'false'); |
| 51 | // Roving tabindex: only the active tab is reachable via Tab key; |
| 52 | // arrow keys move focus within the tablist. |
| 53 | tab.setAttribute('tabindex', isActive ? '0' : '-1'); |
| 54 | }); |
| 55 | container.querySelectorAll('.mdbook-tab-content').forEach(function (pane) { |
| 56 | pane.setAttribute('aria-hidden', pane.classList.contains('hidden') ? 'true' : 'false'); |
| 57 | }); |
| 58 | } |
| 59 | |
| 60 | function syncAll() { |
| 61 | document.querySelectorAll('.mdbook-tabs-container').forEach(syncContainer); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…