mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
28 lines
831 B
JavaScript
28 lines
831 B
JavaScript
$(".numberpicker-down-button").unbind('click').on("click", function()
|
|
{
|
|
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"]');
|
|
inputElement.val(parseFloat(inputElement.val()) + 1);
|
|
inputElement.trigger('keyup');
|
|
inputElement.trigger('change');
|
|
});
|
|
|
|
$(".numberpicker").on("keyup", function()
|
|
{
|
|
if ($(this).attr("data-not-equal") && !$(this).attr("data-not-equal").toString().isEmpty() && $(this).attr("data-not-equal") == $(this).val())
|
|
{
|
|
$(this)[0].setCustomValidity("error");
|
|
}
|
|
else
|
|
{
|
|
$(this)[0].setCustomValidity("");
|
|
}
|
|
});
|