mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Allow partial minimum stock amount when enabled (closes #203)
This commit is contained in:
parent
0496ae9e00
commit
25c257bb2c
@ -215,6 +215,22 @@ $("#enable_tare_weight_handling").on("click", function()
|
||||
Grocy.FrontendHelpers.ValidateForm("product-form");
|
||||
});
|
||||
|
||||
$("#allow_partial_units_in_stock").on("click", function()
|
||||
{
|
||||
if (this.checked)
|
||||
{
|
||||
$("#min_stock_amount").attr("min", "0.00");
|
||||
$("#min_stock_amount").attr("step", "0.01");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#min_stock_amount").attr("min", "0");
|
||||
$("#min_stock_amount").attr("step", "1");
|
||||
}
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm("product-form");
|
||||
});
|
||||
|
||||
Grocy.DeleteProductPictureOnSave = false;
|
||||
$('#delete-current-product-picture-button').on('click', function (e)
|
||||
{
|
||||
@ -245,3 +261,7 @@ if (Grocy.EditMode === 'create')
|
||||
$('#name').focus();
|
||||
$('.input-group-qu').trigger('change');
|
||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||
|
||||
// Click twice to trigger on-click but not change the actual checked state
|
||||
$("#allow_partial_units_in_stock").click();
|
||||
$("#allow_partial_units_in_stock").click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user