From aa0619dd73fb94f9d1375fc1f3edbc16904ba0d7 Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Fri, 20 Dec 2019 11:27:54 -0600 Subject: [PATCH] recipeform: bootbox the recipe pos add button --- public/viewjs/recipeform.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/public/viewjs/recipeform.js b/public/viewjs/recipeform.js index e2bfd6e7..0078d561 100644 --- a/public/viewjs/recipeform.js +++ b/public/viewjs/recipeform.js @@ -243,16 +243,24 @@ $(document).on('click', '.recipe-include-edit-button', function (e) $("#recipe-pos-add-button").on("click", function(e) { - Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(), - function(result) - { - window.location.href = U('/recipe/' + Grocy.EditObjectId + '/pos/new'); - }, - function(xhr) - { - console.error(xhr); + e.preventDefault(); + + bootbox.dialog({ + message: '', + size: 'large', + backdrop: true, + closeButton: false, + buttons: { + cancel: { + label: __t('Cancel'), + className: 'btn-secondary responsive-button', + callback: function() + { + bootbox.hideAll(); + } + } } - ); + }); }); $("#recipe-include-add-button").on("click", function(e)