Skip to content

Commit

Permalink
Prevent form submit when enter is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
mpowaga committed Feb 19, 2015
1 parent d2d0949 commit dfced11
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/client/autoform-map.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
KEY_ENTER = 13

defaults =
mapType: 'roadmap'
defaultLat: 1
Expand Down Expand Up @@ -118,3 +120,6 @@ Template.afMap.events
@setMarker @map, location, @options.zoom
@map.setCenter location
@loading.set false

'keydown .js-search': (e) ->
if e.keyCode == KEY_ENTER then e.preventDefault()

0 comments on commit dfced11

Please sign in to comment.