Added grocycode for recipes (closes #1562)

This commit is contained in:
Bernd Bestel
2022-02-11 17:49:30 +01:00
parent 51fdefaede
commit 222c518a5f
16 changed files with 212 additions and 16 deletions

View File

@@ -414,3 +414,18 @@ if (window.location.hash === "#fullscreen")
}
LoadImagesLazy();
$(document).on('click', '.recipe-grocycode-label-print', function(e)
{
e.preventDefault();
document.activeElement.blur();
var recipeId = $(e.currentTarget).attr('data-recipe-id');
Grocy.Api.Get('recipes/' + recipeId + '/printlabel', function(labelData)
{
if (Grocy.Webhooks.labelprinter !== undefined)
{
Grocy.FrontendHelpers.RunWebhook(Grocy.Webhooks.labelprinter, labelData);
}
});
});