fix selected class bug messed up after refactoring

This commit is contained in:
Robin Scholtes 2023-05-15 12:52:13 +12:00
parent 9a7ec25493
commit 82837254ea

View file

@ -611,7 +611,12 @@ class RecipeWaiter {
* @param {string} opDataName the data-name of the target operation
*/
addSelectedClass(opDataName) {
document.querySelector(`.operation[data-name="${opDataName}"]`).classList.add("selected");
const ops = document.querySelectorAll(`.operation[data-name="${opDataName}"]`);
// A selected operation can occur twice if it's in favourites and the original category op-list
ops.forEach((op => {
op.classList.add("selected");
}))
}
/**