Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Sort dropdown alphabeticaly
Browse files Browse the repository at this point in the history
  • Loading branch information
marqdevx authored Jan 20, 2023
1 parent 8d5f91f commit ca2aa73
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions esea-league-filter-bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ javascript: (() => {
flagOptions.add(newOption);
}


function addFlag(indexTeam) {
flagOptions = flagBox.childNodes[0].childNodes[0];

Expand All @@ -27,18 +26,24 @@ javascript: (() => {
}

totalFlags[flagsCount] = flagName;

addDropDownFlag(flagName);

flagsCount++;
}

function fillDropDown() {
for (let i = 0; i < totalFlags.length; i++) {
addDropDownFlag(totalFlags[i]);
}
}

function indexFlags() {
addDropDownFlag("Country");

for (let i = 1; i < teamList.length; i++) {
addFlag(i);
}

totalFlags = totalFlags.sort();
fillDropDown();
}

function largeCutOff(teamsSize) {
Expand Down Expand Up @@ -184,7 +189,7 @@ javascript: (() => {
flagBox = regionBox.cloneNode(true);
flagBox.childNodes[0].childNodes[0].setAttribute("id", "flag");
flagBox.childNodes[0].childNodes[0].onchange = function() {
filter();
filter()
};
flagBox.childNodes[0].childNodes[0].innerHTML = "";

Expand Down

0 comments on commit ca2aa73

Please sign in to comment.