mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Default shopping list item amount to 1
This commit is contained in:
@@ -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 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
|
- 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 that shopping list prints had a grey background (thanks @Forceu)
|
||||||
- Fixed the form validation on the shopping list item page (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);
|
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();
|
$('#display_amount').focus();
|
||||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||||
Grocy.ShoppingListItemFormInitialLoadDone = true;
|
Grocy.ShoppingListItemFormInitialLoadDone = true;
|
||||||
@@ -244,8 +250,8 @@ if (GetUriParam("embedded") !== undefined)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var eitherRequiredFields = $("#product_id,#product_id_text_input,#note");
|
var eitherRequiredFields = $("#product_id,#product_id_text_input,#note");
|
||||||
eitherRequiredFields.prop('required',"");
|
eitherRequiredFields.prop('required', "");
|
||||||
eitherRequiredFields.on('input', function ()
|
eitherRequiredFields.on('input', function()
|
||||||
{
|
{
|
||||||
eitherRequiredFields.not(this).prop('required', !$(this).val().length);
|
eitherRequiredFields.not(this).prop('required', !$(this).val().length);
|
||||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||||
|
Reference in New Issue
Block a user