mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Non-integer values cannot be entered into shop front quantities
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
Darkswarm.directive "integer", ->
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr) ->
|
||||
elem.bind 'input', ->
|
||||
digits = elem.val().replace(/\D/g, "")
|
||||
elem.val digits
|
||||
@@ -11,6 +11,7 @@
|
||||
.small-5.medium-3.large-3.columns.text-right{"bo-if" => "!variant.product.group_buy"}
|
||||
|
||||
%input{type: :number,
|
||||
integer: true,
|
||||
value: nil,
|
||||
min: 0,
|
||||
placeholder: "0",
|
||||
@@ -26,6 +27,7 @@
|
||||
%span.bulk-input
|
||||
%input.bulk.first{type: :number,
|
||||
value: nil,
|
||||
integer: true,
|
||||
min: 0,
|
||||
"ng-model" => "variant.line_item.quantity",
|
||||
placeholder: "min",
|
||||
@@ -34,6 +36,7 @@
|
||||
name: "variants[{{variant.id}}]", id: "variants_{{variant.id}}"}
|
||||
%span.bulk-input{"bo-if" => "variant.product.group_buy"}
|
||||
%input.bulk.second{type: :number,
|
||||
integer: true,
|
||||
min: 0,
|
||||
"ng-model" => "variant.line_item.max_quantity",
|
||||
placeholder: "max",
|
||||
|
||||
Reference in New Issue
Block a user