mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 17:10:11 +00:00
Allow no product for shopping list items & always in-/decrement by 1 when using the number input arrow buttons (fixes #964)
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
$(".numberpicker-down-button").unbind('click').on("click", function()
|
||||
{
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]')[0];
|
||||
inputElement.stepDown();
|
||||
$(inputElement).trigger('keyup');
|
||||
$(inputElement).trigger('change');
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]');
|
||||
inputElement.val(parseFloat(inputElement.val()) - 1);
|
||||
inputElement.trigger('keyup');
|
||||
inputElement.trigger('change');
|
||||
});
|
||||
|
||||
$(".numberpicker-up-button").unbind('click').on("click", function()
|
||||
{
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]')[0];
|
||||
inputElement.stepUp();
|
||||
$(inputElement).trigger('keyup');
|
||||
$(inputElement).trigger('change');
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]');
|
||||
inputElement.val(parseFloat(inputElement.val()) + 1);
|
||||
inputElement.trigger('keyup');
|
||||
inputElement.trigger('change');
|
||||
});
|
||||
|
||||
$(".numberpicker").on("keyup", function()
|
||||
|
@@ -139,14 +139,7 @@ if (Grocy.EditMode === "edit")
|
||||
|
||||
$('#amount').on('focus', function(e)
|
||||
{
|
||||
if (Grocy.Components.ProductPicker.GetValue().length === 0 && Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK)
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).select();
|
||||
}
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
$('#shoppinglist-form input').keyup(function(event)
|
||||
|
Reference in New Issue
Block a user