Skip to content

Commit

Permalink
Bug Fixing
Browse files Browse the repository at this point in the history
* Fixed levels with more than one " - " in their name not being considered levels
  • Loading branch information
Bluestonex63 committed Jun 6, 2024
1 parent a64086c commit 53152d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ button.addEventListener("click", async function() {
let isIL = getSelectValues(catselv).find(val => Array.from(catselv).map(a => a.value).includes(val)) //.text.split(" - ")[1] == "IL"
if (isIL != undefined) {
for (gene of document.getElementsByName("runsgen")) {gene.disabled = false}
if (Array.from(catselv).find(val => val.value == isIL).text.split(" - ")[1] == "IL") {
if (Array.from(catselv).find(val => val.value == isIL).text.split(" - ").reverse()[0] == "IL") {
lvls.forEach(lvl => {
let opt = document.createElement("option");
opt.innerHTML = `${lvl["name"]}`
Expand Down Expand Up @@ -532,17 +532,17 @@ button.addEventListener("click", async function() {
old_element.parentNode.replaceChild(new_element, old_element);
document.querySelector("#defaultcat").addEventListener("change", (e) => {
if(getSelectValues(e.target).some(v => {
if(Array.from(e.target).find(val => v == val.value).text.split(" - ")[1] == "IL") {
if(getSelectValues(e.target).some(va => {return Array.from(e.target).find(val => va == val.value).text.split(" - ")[1] == "FG"})) {return true}
if(Array.from(e.target).find(val => v == val.value).text.split(" - ").reverse()[0] == "IL") {
if(getSelectValues(e.target).some(va => {return Array.from(e.target).find(val => va == val.value).text.split(" - ").reverse()[0] == "FG"})) {return true}
}
})) {
try {
for (scope of ["IL", "FG"]) {
if (Array.from(e.target).find(val => val.value == getSelectValues(e.target).find(v => {
if (!sellist.includes(v)) {return v}
})).text.split(" - ")[1] == scope) {
})).text.split(" - ").reverse()[0] == scope) {
for (v of getSelectValues(e.target)) {
if (Array.from(e.target).find(val => val.value == v).text.split(" - ")[1] == scope) {
if (Array.from(e.target).find(val => val.value == v).text.split(" - ").reverse()[0] == scope) {
Array.from(e.target).find(val => val.value == v).selected = false
}
}
Expand Down Expand Up @@ -977,7 +977,7 @@ document.querySelector("#submit").addEventListener("click", function() {
alert(al)
return
} else {
console.log(allruns)
console.log(run2.querySelector("#catsel").value, allruns[0]["run"]["variable"])
POSTrun(key.value, allruns)
}
}
Expand Down

0 comments on commit 53152d0

Please sign in to comment.