fix selected class bug messed up after refactoring
This commit is contained in:
parent
9a7ec25493
commit
82837254ea
@ -611,7 +611,12 @@ class RecipeWaiter {
|
|||||||
* @param {string} opDataName the data-name of the target operation
|
* @param {string} opDataName the data-name of the target operation
|
||||||
*/
|
*/
|
||||||
addSelectedClass(opDataName) {
|
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");
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user