mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Also show the stock QU (as on all other places) after a product is selected on the chore edit page (references #279)
This commit is contained in:
parent
3df44697bf
commit
ba089a3d79
@ -106,6 +106,8 @@ setTimeout(function()
|
||||
// Click twice to trigger on-click but not change the actual checked state
|
||||
$("#consume_product_on_execution").click();
|
||||
$("#consume_product_on_execution").click();
|
||||
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
}, 100);
|
||||
|
||||
$('.input-group-chore-period-type').on('change', function(e)
|
||||
@ -200,3 +202,22 @@ $("#consume_product_on_execution").on("click", function()
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm("chore-form");
|
||||
});
|
||||
|
||||
Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
{
|
||||
var productId = $(e.target).val();
|
||||
|
||||
if (productId)
|
||||
{
|
||||
Grocy.Api.Get('stock/products/' + productId,
|
||||
function(productDetails)
|
||||
{
|
||||
$('#amount_qu_unit').text(productDetails.quantity_unit_stock.name);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user