mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed that the number picker up/down buttons did not work when the input field was empty or contained an invalid number
This commit is contained in:
parent
791a17fcad
commit
d23fda245e
@ -21,8 +21,9 @@
|
||||
### Userfield fixes
|
||||
- Fixed that numeric Userfields were initialised with `1.0`
|
||||
|
||||
### General & other improvements
|
||||
### General & other improvements/fixes
|
||||
- Some night mode style improvements (thanks @BlizzWave and @KTibow)
|
||||
- Fixed that the number picker up/down buttons did not work when the input field was empty or contained an invalid number
|
||||
|
||||
### API fixes
|
||||
- Fixed that due soon products with `due_type` = "Expiration date" were missing in `due_products` of the `/stock/volatile` endpoint
|
||||
|
@ -1,7 +1,7 @@
|
||||
$(".numberpicker-down-button").unbind('click').on("click", function()
|
||||
{
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]');
|
||||
inputElement.val(parseFloat(inputElement.val()) - 1);
|
||||
inputElement.val(parseFloat(inputElement.val() || 1) - 1);
|
||||
inputElement.trigger('keyup');
|
||||
inputElement.trigger('change');
|
||||
});
|
||||
@ -9,7 +9,7 @@ $(".numberpicker-down-button").unbind('click').on("click", function()
|
||||
$(".numberpicker-up-button").unbind('click').on("click", function()
|
||||
{
|
||||
var inputElement = $(this).parent().parent().find('input[type="number"]');
|
||||
inputElement.val(parseFloat(inputElement.val()) + 1);
|
||||
inputElement.val(parseFloat(inputElement.val() || 0) + 1);
|
||||
inputElement.trigger('keyup');
|
||||
inputElement.trigger('change');
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user