1export function createNavigation(container, model, onChange) { 2 3 let currentRound = 0; 4 5 // no permitimos avanzar hasta final 6 const maxRound = model.rounds.length - 2; 7 8 const nav = document.createElement('div'); 9 nav.className = 'bracket-nav'; 10 11 nav.innerHTML = ` 12 <button class="bracket-nav-prev"><</button> 13 <button class="bracket-nav-next">></button> 14 `; 15 16 container.prepend(nav); 17 18 const prevBtn = nav.querySelector('.bracket-nav-prev'); 19 const nextBtn = nav.querySelector('.bracket-nav-next'); 20 21 function update() { 22 23 prevBtn.disabled = currentRound === 0; 24 nextBtn.disabled = currentRound === maxRound; 25 26 onChange(currentRound); 27 } 28 29 prevBtn.addEventListener('click', () => { 30 31 if (currentRound <= 0) return; 32 33 currentRound--; 34 35 update(); 36 }); 37 38 nextBtn.addEventListener('click', () => { 39 40 if (currentRound >= maxRound) return; 41 42 currentRound++; 43 44 update(); 45 }); 46 47 update(); 48}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.