Non-integer values cannot be entered into shop front quantities

This commit is contained in:
Maikel Linke
2015-09-03 17:42:26 +10:00
parent ced254919a
commit 0895bd8647
2 changed files with 9 additions and 0 deletions

View File

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