diff --git a/public/viewjs/components/numberpicker.js b/public/viewjs/components/numberpicker.js index 5d54aea7..d66f870b 100644 --- a/public/viewjs/components/numberpicker.js +++ b/public/viewjs/components/numberpicker.js @@ -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() diff --git a/public/viewjs/shoppinglistitemform.js b/public/viewjs/shoppinglistitemform.js index f08dae77..5d8da8d0 100644 --- a/public/viewjs/shoppinglistitemform.js +++ b/public/viewjs/shoppinglistitemform.js @@ -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) diff --git a/views/choreform.blade.php b/views/choreform.blade.php index a3b47f78..a844a625 100644 --- a/views/choreform.blade.php +++ b/views/choreform.blade.php @@ -256,7 +256,6 @@ 'label' => 'Amount', 'hintId' => 'amount_qu_unit', 'min' => 0.0001, - 'step' => 0.0001, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'), 'isRequired' => false, 'value' => $value diff --git a/views/components/numberpicker.blade.php b/views/components/numberpicker.blade.php index 8e18395d..0ad4543a 100644 --- a/views/components/numberpicker.blade.php +++ b/views/components/numberpicker.blade.php @@ -5,7 +5,6 @@ @php if(!isset($value)) { $value = 1; } @endphp @php if(empty($min)) { $min = 0; } @endphp @php if(empty($max)) { $max = 999999; } @endphp -@php if(empty($step)) { $step = 1; } @endphp @php if(empty($hint)) { $hint = ''; } @endphp @php if(empty($hintId)) { $hintId = ''; } @endphp @php if(empty($additionalCssClasses)) { $additionalCssClasses = ''; } @endphp @@ -36,7 +35,7 @@ value="{{ $value }}" min="{{ $min }}" max="{{ $max }}" - step="{{ $step }}" + step="{{ $min }}" @if($isRequired) required @endif> diff --git a/views/components/userfieldsform.blade.php b/views/components/userfieldsform.blade.php index 09b5de50..9b0dbf57 100644 --- a/views/components/userfieldsform.blade.php +++ b/views/components/userfieldsform.blade.php @@ -42,7 +42,6 @@ 'label' => $userfield->caption, 'noNameAttribute' => true, 'min' => 0, - 'step' => 0.01, 'isRequired' => false, 'additionalCssClasses' => 'userfield-input', 'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"' diff --git a/views/inventory.blade.php b/views/inventory.blade.php index 1f430f39..39c23757 100644 --- a/views/inventory.blade.php +++ b/views/inventory.blade.php @@ -64,7 +64,6 @@ 'id' => 'price', 'label' => 'Price', 'min' => 0, - 'step' => 0.01, 'value' => '', 'hint' => $__t('in %s per purchase quantity unit', GROCY_CURRENCY), 'additionalHtmlContextHelp' => '
' . $__t('This will apply to added products') . '', diff --git a/views/productform.blade.php b/views/productform.blade.php index ae26acd5..bccbc1f0 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -286,7 +286,6 @@ 'id' => 'tare_weight', 'label' => 'Tare weight', 'min' => 0, - 'step' => 0.01, 'value' => $value, 'invalidFeedback' => $__t('This cannot be lower than %s', '0'), 'additionalAttributes' => $additionalAttributes, @@ -315,7 +314,6 @@ 'id' => 'calories', 'label' => 'Energy (kcal)', 'min' => 0, - 'step' => 0.01, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'), 'hint' => $__t('Per stock quantity unit'), diff --git a/views/purchase.blade.php b/views/purchase.blade.php index df6c326a..b4b717dc 100644 --- a/views/purchase.blade.php +++ b/views/purchase.blade.php @@ -94,7 +94,6 @@ 'id' => 'price', 'label' => 'Price', 'min' => 0, - 'step' => 0.01, 'value' => '', 'hintId' => 'price-hint', 'invalidFeedback' => $__t('The price cannot be lower than %s', '0'), diff --git a/views/quantityunitconversionform.blade.php b/views/quantityunitconversionform.blade.php index 0961c6cf..781b50cb 100644 --- a/views/quantityunitconversionform.blade.php +++ b/views/quantityunitconversionform.blade.php @@ -82,7 +82,6 @@ 'id' => 'factor', 'label' => 'Factor', 'min' => 0, - 'step' => 0.001, 'value' => $value, 'invalidFeedback' => $__t('This cannot be lower than %1$s and must be a valid number with max. %2$s decimal places', '0', '3'), 'additionalHtmlElements' => '

'amount', 'label' => 'Amount', 'min' => 0, - 'step' => 1, 'isRequired' => false, 'value' => 1 )) diff --git a/views/recipeposform.blade.php b/views/recipeposform.blade.php index cac8c8e4..8f9e8085 100644 --- a/views/recipeposform.blade.php +++ b/views/recipeposform.blade.php @@ -107,7 +107,6 @@ 'id' => 'price_factor', 'label' => 'Price factor', 'min' => 0, - 'step' => 0.01, 'value' => '', 'hint' => $__t('The resulting price of this ingredient will be multiplied by this factor'), 'invalidFeedback' => $__t('This cannot be lower than %s', '0'), diff --git a/views/shoppinglistitemform.blade.php b/views/shoppinglistitemform.blade.php index ccdea0b2..097787f9 100644 --- a/views/shoppinglistitemform.blade.php +++ b/views/shoppinglistitemform.blade.php @@ -50,7 +50,7 @@ value="1"> @endif -

+
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp @include('components.productpicker', array( 'products' => $products, @@ -65,7 +65,6 @@ 'label' => 'Amount', 'hintId' => 'amount_qu_unit', 'min' => 0.01, - 'step' => 0.01, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0.01') )) diff --git a/views/stockentryform.blade.php b/views/stockentryform.blade.php index 6b4c46ab..93b5f889 100644 --- a/views/stockentryform.blade.php +++ b/views/stockentryform.blade.php @@ -89,7 +89,6 @@ 'value' => $price, 'label' => 'Price', 'min' => 0, - 'step' => 0.01, 'hint' => $__t('in %s per purchase quantity unit', GROCY_CURRENCY), 'invalidFeedback' => $__t('The price cannot be lower than %s', '0'), 'isRequired' => false