mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Default shopping list item amount to 1
This commit is contained in:
parent
dabc48fed3
commit
791a17fcad
@ -5,7 +5,8 @@
|
||||
- Fixed that the current stock total value (header of the stock overview page) didn't include decimal amounts (thanks @Ape)
|
||||
- Fixed that the transfer page was not fully populated when opening it from the stock entries page
|
||||
|
||||
### Shopping list fixes
|
||||
### Shopping list improvements/fixes
|
||||
- The amount now defaults to `1` for adding items quicker
|
||||
- Fixed that shopping list prints had a grey background (thanks @Forceu)
|
||||
- Fixed the form validation on the shopping list item page (thanks @Forceu)
|
||||
|
||||
|
@ -162,6 +162,12 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.default_quantity_unit_purchase.id);
|
||||
}
|
||||
|
||||
if ($("#display_amount").val().toString().isEmpty())
|
||||
{
|
||||
$("#display_amount").val(1);
|
||||
$("#display_amount").trigger("change");
|
||||
}
|
||||
|
||||
$('#display_amount').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||
Grocy.ShoppingListItemFormInitialLoadDone = true;
|
||||
@ -244,8 +250,8 @@ if (GetUriParam("embedded") !== undefined)
|
||||
}
|
||||
|
||||
var eitherRequiredFields = $("#product_id,#product_id_text_input,#note");
|
||||
eitherRequiredFields.prop('required',"");
|
||||
eitherRequiredFields.on('input', function ()
|
||||
eitherRequiredFields.prop('required', "");
|
||||
eitherRequiredFields.on('input', function()
|
||||
{
|
||||
eitherRequiredFields.not(this).prop('required', !$(this).val().length);
|
||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||
|
Loading…
x
Reference in New Issue
Block a user