From 7c2320e9789c7e5c056dc786ab485407dfdfa06f Mon Sep 17 00:00:00 2001 From: kriddles <54413450+kriddles@users.noreply.github.com> Date: Fri, 17 Jan 2020 11:13:43 -0600 Subject: [PATCH] refresh productcard on save (#495) --- public/viewjs/consume.js | 1 + public/viewjs/inventory.js | 1 + public/viewjs/purchase.js | 1 + public/viewjs/transfer.js | 1 + 4 files changed, 4 insertions(+) diff --git a/public/viewjs/consume.js b/public/viewjs/consume.js index 2b37f23c..18d9f808 100644 --- a/public/viewjs/consume.js +++ b/public/viewjs/consume.js @@ -130,6 +130,7 @@ $('#save-consume-button').on('click', function(e) $("#location_id").find("option").remove().end().append(""); } Grocy.Components.ProductPicker.GetInputElement().focus(); + Grocy.Components.ProductCard.Refresh(jsonForm.product_id); Grocy.FrontendHelpers.ValidateForm('consume-form'); } }, diff --git a/public/viewjs/inventory.js b/public/viewjs/inventory.js index 1c044519..69195c0f 100644 --- a/public/viewjs/inventory.js +++ b/public/viewjs/inventory.js @@ -88,6 +88,7 @@ Grocy.Components.DateTimePicker.Clear(); Grocy.Components.ProductPicker.SetValue(''); Grocy.Components.ProductPicker.GetInputElement().focus(); + Grocy.Components.ProductCard.Refresh(jsonForm.product_id); Grocy.FrontendHelpers.ValidateForm('inventory-form'); } }, diff --git a/public/viewjs/purchase.js b/public/viewjs/purchase.js index 368264cc..51270ac1 100644 --- a/public/viewjs/purchase.js +++ b/public/viewjs/purchase.js @@ -99,6 +99,7 @@ Grocy.Components.DateTimePicker.Clear(); Grocy.Components.ProductPicker.SetValue(''); Grocy.Components.ProductPicker.GetInputElement().focus(); + Grocy.Components.ProductCard.Refresh(jsonForm.product_id); Grocy.FrontendHelpers.ValidateForm('purchase-form'); } }, diff --git a/public/viewjs/transfer.js b/public/viewjs/transfer.js index f6fdcb66..88d2d111 100644 --- a/public/viewjs/transfer.js +++ b/public/viewjs/transfer.js @@ -114,6 +114,7 @@ $('#save-transfer-button').on('click', function(e) $("#location_id_to").val(""); $("#location_id_from").val(""); Grocy.Components.ProductPicker.GetInputElement().focus(); + Grocy.Components.ProductCard.Refresh(jsonForm.product_id); Grocy.FrontendHelpers.ValidateForm('transfer-form'); } },