Skip to content

Commit

Permalink
Reset form validation on modal close
Browse files Browse the repository at this point in the history
  • Loading branch information
mpowaga committed Jul 7, 2015
1 parent d9b4298 commit cc79d8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/client/modals.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
registeredAutoFormHooks = ['cmForm']
defaultFormId = 'cmForm'

cmOnSuccessCallback = null

Expand All @@ -24,6 +25,8 @@ Template.autoformModals.rendered = ->
$('#afModal').on 'hidden.bs.modal', ->
$(window).unbind 'keyup', onEscKey

AutoForm.resetForm(Session.get('cmFormId') or defaultFormId)

sessionKeys = [
'cmCollection',
'cmOperation',
Expand Down Expand Up @@ -92,7 +95,7 @@ helpers =
cmPlaceholder: () ->
Session.get 'cmPlaceholder'
cmFormId: () ->
Session.get('cmFormId') or 'cmForm'
Session.get('cmFormId') or defaultFormId
cmAutoformType: () ->
if Session.get 'cmMeteorMethod'
'method'
Expand Down

0 comments on commit cc79d8e

Please sign in to comment.