Fixed that the recipe page was reloaded when expanding a collapsed row on mobile (fixes #589)

This commit is contained in:
Bernd Bestel 2020-03-06 20:51:09 +01:00
parent e2bb3a7d00
commit 5cfe7cf34d
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,7 @@ If you run grocy in a subdirectory, you need to set a new `config.php` setting (
- Fixed that nested recipes showed all ingredients of the nested recipes twice
- Fixed that when displaying or consuming a recipe from the meal plan the serving amount was maybe wrong (was the one from the recipe instead the one from the meal plan entry) (thanks @kriddles)
- Fixed that the stock fulfillment counts on the recipe card were maybe wrong if that recipe was also added to the meal plan (thanks @kriddles)
- Fixed that the recipe page was reloaded when expanding a collapsed row on mobile (thanks @Mikhail5555)
### Meal plan improvements
- Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product

View File

@ -208,7 +208,11 @@ recipesTables.on('select', function(e, dt, type, indexes)
if (type === 'row')
{
var selectedRecipeId = $(recipesTables.row(indexes[0]).node()).data("recipe-id");
window.location.href = U('/recipes?recipe=' + selectedRecipeId.toString());
var currentRecipeId = location.search.split('recipe=')[1];
if (selectedRecipeId.toString() !== currentRecipeId)
{
window.location.href = U('/recipes?recipe=' + selectedRecipeId.toString());
}
}
});