on user test request: when the recipe pane is maximised but the rec-list is empty, open the operations-dropdown on click of the recipe-list ( which holds no items )

This commit is contained in:
Robin Scholtes 2023-05-15 20:54:49 +12:00
parent f5f0e91d51
commit 4b030c7d61
3 changed files with 26 additions and 4 deletions

View file

@ -620,17 +620,18 @@ class RecipeWaiter {
}))
}
/**
* Update which items are selected in op-list.
*
* First, all selected classes are removed from op-list, then we get the current
* recipe-list ingredient names and add 'selected' back to the matching operations.
*
* Note: It seems a little overkill, but with the current tightly coupled code this is
* a reliable way to make sure the 'selected' operations are always in sync with
* Note: It seems a little overkill to nuke all selected classes, but with the current
* code this is a reliable way to make sure the 'selected' operations are always in sync with
* the recipe list ( I think this is preferable to complicating a lot of existing
* code ), I'd recommend to refactor this at one point, but that would mean a huge code
* overhaul for another time / issue.
* code ), I'd recommend to refactor this at one point, but that should go hand in hand
* with a huge code overhaul for another time / issue.
*/
updateSelectedOperations() {
const recipeListItems = document.querySelectorAll("#rec-list > li");
@ -648,6 +649,8 @@ class RecipeWaiter {
});
});
}
}
export default RecipeWaiter;