diff options
Diffstat (limited to 'src/manage.js')
| -rw-r--r-- | src/manage.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/manage.js b/src/manage.js index 6ed58bd..83a9b4c 100644 --- a/src/manage.js +++ b/src/manage.js @@ -95,8 +95,12 @@ function normalize(data) { export class GuestManager extends Manager { constructor(description, count) { - if ( typeof description === "undefined" ) { description = "Guest"; }; - if ( typeof count === "undefined" ) { count = 18; }; + if (typeof description === "undefined") { + description = "Guest"; + } + if (typeof count === "undefined") { + count = 18; + } super(description, count); } createItem(i) { @@ -112,7 +116,7 @@ export class GuestManager extends Manager { return normalize(super.active()); } incrementGames(list) { - for (let index = 0; index < this.data.length; index++ ){ + for (let index = 0; index < this.data.length; index++) { if (list.includes(this.data[index].name)) { console.log("Added game count to " + this.data[index].name); this.data[index].games += 1; @@ -145,7 +149,7 @@ export class RegularManager extends GuestManager { return new Regular(id, status, level, games, firstName, lastName); } reset() { - for (let index = 0; index < this.data.length; index++ ){ + for (let index = 0; index < this.data.length; index++) { this.data[index].games = 0; this.data[index].status = false; } @@ -177,6 +181,10 @@ function parseCsv(data) { return players; } +document.getElementById("button-player-load").addEventListener("click", () => { + document.getElementById("player-load").click(); +}); + function addLoadBehaviour(p) { const f = document.getElementById("player-load"); f.addEventListener("change", () => { |
