diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-11-06 19:04:18 -0500 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-11-06 19:04:18 -0500 |
commit | 7af9d162ab82c6e6eb38a1e3cd1b06afd884d93a (patch) | |
tree | d64eb1373318c77703df03cdcfa45f2e8ae94c98 /src/components/registry-element.js | |
parent | fd2cae2643663d67f2677da676e800fe1f91aefd (diff) |
Made multiple changes, fixing typos and a major bug with showing divisons.
Diffstat (limited to 'src/components/registry-element.js')
-rw-r--r-- | src/components/registry-element.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/components/registry-element.js b/src/components/registry-element.js index c54bd43..cbca5bf 100644 --- a/src/components/registry-element.js +++ b/src/components/registry-element.js @@ -103,14 +103,16 @@ class RegistryElement extends LitElement { super(); this.name = ""; - this.emails = []; this.divisons = []; this.infoTabOpen = false; } + _firstRendered() { + this.fillNames(); + } + toggleTabOpen() { - this.sortNames(); this.infoTabOpen = true; } @@ -118,7 +120,7 @@ class RegistryElement extends LitElement { this.infoTabOpen = false; } - sortNames() { + fillNames() { var thetas = this.shadowRoot.getElementById('name-list-theta'); var alphas = this.shadowRoot.getElementById('name-list-alpha'); var mus = this.shadowRoot.getElementById('name-list-mu'); @@ -131,21 +133,21 @@ class RegistryElement extends LitElement { stats .innerHTML = ""; other .innerHTML = ""; - for(var i=0; i<this.emails.length; i++) { - var listElement = document .createElement('li'); - listElement.innerHTML = this.emails[i] .replace('@communityschoolnaples.org', ''); - if (this.divisons[i].includes('Mu')) { + this.divisons.forEach((d) => { + var listElement = document .createElement('li'); + listElement.innerHTML = d[0]; + if (d[1].includes('Mu')) { mus .appendChild(listElement); - } else if (this.divisons[i].includes('Alpha')) { + } else if (d[1].includes('Alpha')) { alphas .appendChild(listElement) - } else if (this.divisons[i].includes('Theta')) { + } else if (d[1].includes('Theta')) { thetas .appendChild(listElement) - } else if (this.divisons[i].includes('Stats')) { + } else if (d[1].includes('Stats')) { stats .appendChild(listElement) } else { other .appendChild(listElement); } - } + }); } |