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:
Bernd Bestel
2020-10-18 14:27:23 +02:00
parent 7e08224c75
commit 80cf68aeaa
13 changed files with 11 additions and 30 deletions

View File

@@ -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()

View File

@@ -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)