fixed linting errors

This commit is contained in:
j264415 2024-02-19 14:08:00 +00:00
parent 6b1086ddb9
commit 959aa709c3
2 changed files with 33 additions and 33 deletions

View file

@ -291,7 +291,7 @@ class OperationsWaiter {
const cat = document.getElementById("categories");
for (let i = 0; i < cat.children.length; i++) {
cat.children[i].addEventListener("keydown", this.keyboardEventHandler, false);
};
}
}
/**
@ -303,7 +303,7 @@ class OperationsWaiter {
if (ev.key === "Enter" || ev.key === "Space" || ev.key === " ") {
ev.preventDefault();
for (let i = 0; i < ev.target.childNodes.length; i++) {
let targetChild = ev.target.childNodes[i].classList;
const targetChild = ev.target.childNodes[i].classList;
if (targetChild !== undefined && targetChild.value.includes("panel-collapse collapse")) {
if (!targetChild.contains("show")) {
targetChild.add("show");
@ -311,22 +311,22 @@ class OperationsWaiter {
targetChild.remove("show");
}
};
}
}
}
};
}
/**
* Handler to populate recipe.
* Get the children of op-list and add event listener to them.
*/
operationPopulateRecipe() {
let cat = document.querySelectorAll(".op-list li.operation");
const cat = document.querySelectorAll(".op-list li.operation");
for (let i = 0; i < cat.children.length; i++) {
cat.children[i].addEventListener("keydown", this.keyboardPopulateRecipe, false);
};
}
}
@ -337,7 +337,7 @@ class OperationsWaiter {
*/
keyboardPopulateRecipe(ev) {
if (ev.ctrlKey && ev.key === "Enter") {
const li = ev.target
const li = ev.target;
this.manager.recipe.addOperation(li.textContent);
}
}