Finalize recipes feature

This commit is contained in:
Bernd Bestel
2018-07-15 09:56:10 +02:00
parent be650d093d
commit ea0f5101ec
9 changed files with 108 additions and 38 deletions

View File

@@ -11,6 +11,12 @@
'select': 'single'
});
var rowSelect = GetUriParam("row");
if (typeof rowSelect !== "undefined")
{
recipesTables.row(rowSelect).select();
}
$("#search").on("keyup", function()
{
var value = $(this).val();
@@ -93,3 +99,17 @@ $(document).on('click', '.recipe-order-missing-button', function(e)
}
});
});
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() + "&row=" + indexes[0].toString());
}
});
$("#selectedRecipeToggleFullscreenButton").on('click', function(e)
{
$("#selectedRecipeCard").toggleClass("fullscreen");
});