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

@ -489,6 +489,24 @@ ${navigator.userAgent}
btn.setAttribute("data-original-title", "Maximise pane");
}
}
/**
* If #recipe is maximised and #rec-list is empty, clicking / tapping on
* the ( empty ) list will open #operations-dropdown to help guide users
* with that they are supposed to do
*/
onMaximisedRecipeClick() {
if (this.app.isMobileView()
// if #recipe is maximised
&& document.querySelector("#recipe.maximised-pane")
// and #rec-list is empty
&& document.querySelectorAll("#rec-list > li").length === 0 ) {
// close max pane and display the expanded #operations-dropdown
this.setPaneMaximised("recipe", false);
this.manager.ops.openOperationsDropdown();
}
}
}
export default ControlsWaiter;