Toggle V2

This commit is contained in:
Greg 2025-05-10 19:47:02 +02:00
parent 1b21d364e7
commit 0c2eea73ec

View File

@ -159,17 +159,15 @@ function renderTable() {
}, 0);
}
window.onload = () => {
document.addEventListener('DOMContentLoaded', () => {
fetchData();
document.addEventListener('DOMContentLoaded', () => {
const toggleBtn = document.getElementById('toggle-matches-btn');
if (toggleBtn) {
toggleBtn.textContent = 'Show All Matches';
toggleBtn.onclick = () => {
showAllMatches = !showAllMatches;
toggleBtn.textContent = showAllMatches ? 'Show Future Matches' : 'Show All Matches';
renderTable();
};
}
});
};
const toggleBtn = document.getElementById('toggle-matches-btn');
if (toggleBtn) {
toggleBtn.textContent = 'Show All Matches';
toggleBtn.onclick = () => {
showAllMatches = !showAllMatches;
toggleBtn.textContent = showAllMatches ? 'Show Future Matches' : 'Show All Matches';
renderTable();
};
}
});