aboutsummaryrefslogtreecommitdiff
path: root/utils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'utils.mjs')
-rw-r--r--utils.mjs19
1 files changed, 17 insertions, 2 deletions
diff --git a/utils.mjs b/utils.mjs
index e639916..968731c 100644
--- a/utils.mjs
+++ b/utils.mjs
@@ -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