mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 17:10:11 +00:00
Scoll to the recipe card after selecting a recipe on mobile devices (closes #547)
This commit is contained in:
@@ -26,7 +26,16 @@ if (typeof recipe !== "undefined")
|
||||
|
||||
var cardId = "#recipe-card-" + recipe;
|
||||
$(cardId).addClass("bg-primary").addClass("text-white");
|
||||
$(cardId)[0].scrollIntoView();
|
||||
|
||||
if ($(window).width() < 768)
|
||||
{
|
||||
// Scroll to recipe card on mobile
|
||||
$("#selectedRecipeCard")[0].scrollIntoView();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(cardId)[0].scrollIntoView();
|
||||
}
|
||||
}
|
||||
|
||||
if (GetUriParam("search") !== undefined)
|
||||
|
Reference in New Issue
Block a user