recipeform: bootbox the recipe pos add button

This commit is contained in:
Kurt Riddlesperger 2019-12-20 11:27:54 -06:00
parent 26920185f1
commit aa0619dd73

View File

@ -243,16 +243,24 @@ $(document).on('click', '.recipe-include-edit-button', function (e)
$("#recipe-pos-add-button").on("click", function(e) $("#recipe-pos-add-button").on("click", function(e)
{ {
Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(), e.preventDefault();
function(result)
bootbox.dialog({
message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipe/") + Grocy.EditObjectId + '/pos/new?embedded"></iframe>',
size: 'large',
backdrop: true,
closeButton: false,
buttons: {
cancel: {
label: __t('Cancel'),
className: 'btn-secondary responsive-button',
callback: function()
{ {
window.location.href = U('/recipe/' + Grocy.EditObjectId + '/pos/new'); bootbox.hideAll();
},
function(xhr)
{
console.error(xhr);
} }
); }
}
});
}); });
$("#recipe-include-add-button").on("click", function(e) $("#recipe-include-add-button").on("click", function(e)