Recipe form updates (#476)

* recipePosForm - hide when embeded productcard

* recipeposform: remove prefillByName for productPicker

* recipeform add data-product-id

* recipeposform cleanup extra clicks

* recipeform: bootbox the recipe pos edit button

* recipeform: bootbox the recipe pos add button

* recipeposform postMessage back

* recipeform reload if IngredientsChanged

* Fix page reload for new recipes (URL = /recipe/new)

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
kriddles
2019-12-21 05:36:02 -06:00
committed by Bernd Bestel
parent 2a361a9f72
commit 36e8484046
4 changed files with 58 additions and 30 deletions

View File

@@ -15,7 +15,8 @@ $('#save-recipe-pos-button').on('click', function (e)
Grocy.Api.Post('objects/recipes_pos', jsonData,
function(result)
{
window.location.href = U('/recipe/' + Grocy.EditObjectParentId);
window.parent.postMessage(WindowMessageBag("IngredientsChanged"), Grocy.BaseUrl);
window.parent.postMessage(WindowMessageBag("CloseAllModals"), Grocy.BaseUrl);
},
function(xhr)
{
@@ -29,7 +30,8 @@ $('#save-recipe-pos-button').on('click', function (e)
Grocy.Api.Put('objects/recipes_pos/' + Grocy.EditObjectId, jsonData,
function(result)
{
window.location.href = U('/recipe/' + Grocy.EditObjectParentId);
window.parent.postMessage(WindowMessageBag("IngredientsChanged"), Grocy.BaseUrl);
window.parent.postMessage(WindowMessageBag("CloseAllModals"), Grocy.BaseUrl);
},
function(xhr)
{
@@ -152,5 +154,5 @@ $("#only_check_single_unit_in_stock").on("click", function()
});
// Click twice to trigger on-click but not change the actual checked state
$("#only_check_single_unit_in_stock").click();
$("#only_check_single_unit_in_stock").click();
//$("#only_check_single_unit_in_stock").click();
//$("#only_check_single_unit_in_stock").click();