mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Implemented scalable recipes (closes #127)
This commit is contained in:
@@ -110,7 +110,7 @@ $('#recipes-includes-table tbody').removeClass("d-none");
|
||||
Grocy.FrontendHelpers.ValidateForm('recipe-form');
|
||||
$("#name").focus();
|
||||
|
||||
$('#recipe-form input').keyup(function (event)
|
||||
$('#recipe-form input').keyup(function(event)
|
||||
{
|
||||
Grocy.FrontendHelpers.ValidateForm('recipe-form');
|
||||
});
|
||||
@@ -206,31 +206,6 @@ $(document).on('click', '.recipe-include-delete-button', function(e)
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.recipe-pos-order-missing-button', function(e)
|
||||
{
|
||||
var productName = $(e.currentTarget).attr('data-product-name');
|
||||
var productId = $(e.currentTarget).attr('data-product-id');
|
||||
var productAmount = $(e.currentTarget).attr('data-product-amount');
|
||||
var recipeName = $(e.currentTarget).attr('data-recipe-name');
|
||||
|
||||
var jsonData = {};
|
||||
jsonData.product_id = productId;
|
||||
jsonData.amount = productAmount;
|
||||
jsonData.note = L('Added for recipe #1', recipeName);
|
||||
|
||||
Grocy.Api.Post('objects/shopping_list', jsonData,
|
||||
function(result)
|
||||
{
|
||||
Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(), function () { }, function () { });
|
||||
window.location.href = U('/recipe/' + Grocy.EditObjectId);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(document).on('click', '.recipe-pos-show-note-button', function(e)
|
||||
{
|
||||
var note = $(e.currentTarget).attr('data-recipe-pos-note');
|
||||
|
Reference in New Issue
Block a user