mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Preselect the default serving size when adding a nested recipe (closes #500)
This commit is contained in:
parent
6f035fd64d
commit
22c978c8dc
@ -348,3 +348,23 @@ $(window).on("message", function(e)
|
||||
window.location.href = U('/recipe/' + Grocy.EditObjectId);
|
||||
}
|
||||
});
|
||||
|
||||
Grocy.Components.RecipePicker.GetPicker().on('change', function (e)
|
||||
{
|
||||
var value = Grocy.Components.RecipePicker.GetValue();
|
||||
if (value.toString().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Grocy.Api.Get('objects/recipes/' + value,
|
||||
function(recipe)
|
||||
{
|
||||
$("#includes_servings").val(recipe.servings);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user