aboutsummaryrefslogtreecommitdiff
path: root/src/components/registry-element.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/registry-element.js')
-rw-r--r--src/components/registry-element.js24
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);
}
- }
+ });
}