diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-11 16:23:12 +0100 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-11 16:23:12 +0100 |
| commit | 5dcf65616f82cb9b652f6913c93e26ff50983fdf (patch) | |
| tree | d5e04b77772b5845d4bd3106ad968322d41739a9 /utils.mjs | |
| parent | dd0c6a458ef5229a5fddf0e7cae25fb3a5d495f7 (diff) | |
Data load added
Diffstat (limited to 'utils.mjs')
| -rw-r--r-- | utils.mjs | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -3,11 +3,26 @@ export function addToggleBehaviour(list, description) { let listId = description + 'list'; document.getElementById(listId).innerHTML = renderedHTML; for (let index = 0; index < list.length; ++index) { - const p = document.getElementById(description + index); + const p = document.getElementById(description + list[index].id); p.addEventListener("click", () => { list[index].toggle(); p.classList.toggle('is-success'); p.classList.toggle('is-danger'); }); } -}
\ No newline at end of file +} + +// document.querySelector("#player-load input[type=file]").onchange = () => { +// if (fileInput.files.length > 0) { +// const file = fileInput.files[0]; +// if (file) { +// const reader = new FileReader(); +// reader.onload = function(e) { +// const content = e.target.result; +// regulars = csvToPlayers(content); +// addToggleBehaviour(regulars, "regular_"); +// }; +// reader.readAsText(file); +// } +// } +// }
\ No newline at end of file |
