mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
recipeform: bootbox the recipe pos edit button
This commit is contained in:
parent
73b2a44b9b
commit
26920185f1
|
|
@ -192,20 +192,29 @@ $(document).on('click', '.recipe-pos-show-note-button', function(e)
|
||||||
bootbox.alert(note);
|
bootbox.alert(note);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.recipe-pos-edit-button', function (e)
|
$(document).on('click', '.recipe-pos-edit-button', function(e)
|
||||||
{
|
{
|
||||||
var recipePosId = $(e.currentTarget).attr('data-recipe-pos-id');
|
e.preventDefault();
|
||||||
|
|
||||||
Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(),
|
var productId = $(e.currentTarget).attr("data-product-id");
|
||||||
function(result)
|
var recipePosId = $(e.currentTarget).attr('data-recipe-pos-id');
|
||||||
{
|
|
||||||
window.location.href = U('/recipe/' + Grocy.EditObjectId + '/pos/' + recipePosId);
|
bootbox.dialog({
|
||||||
},
|
message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipe/") + Grocy.EditObjectId.toString() + '/pos/' + recipePosId.toString() + '?embedded&product=' + productId.toString() + '"></iframe>',
|
||||||
function(xhr)
|
size: 'large',
|
||||||
{
|
backdrop: true,
|
||||||
console.error(xhr);
|
closeButton: false,
|
||||||
|
buttons: {
|
||||||
|
cancel: {
|
||||||
|
label: __t('Cancel'),
|
||||||
|
className: 'btn-secondary responsive-button',
|
||||||
|
callback: function()
|
||||||
|
{
|
||||||
|
bootbox.hideAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.recipe-include-edit-button', function (e)
|
$(document).on('click', '.recipe-include-edit-button', function (e)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user