Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Focus on first input after adding

  • Loading branch information...
commit 0f7a0ab4f664511dcc5e6fb162e9c8e9f187ab16 1 parent 64050a7
@haines authored
Showing with 2 additions and 1 deletion.
  1. +0 −1  .rvmrc
  2. +2 −0  app/assets/javascripts/nested_form.js.coffee
View
1  .rvmrc
@@ -1 +0,0 @@
-rvm use 1.9.2@nested_form --create
View
2  app/assets/javascripts/nested_form.js.coffee
@@ -6,6 +6,8 @@ jQuery ($) ->
content = content.replace(new RegExp("new_#{association}", 'g'), "new_#{new Date().getTime()}")
added = $(content).insertBefore($(this).closest('.nested-form.add'))
+ $(":input:visible:enabled:first", added).focus()
+
$(this).closest('form').trigger(type: 'nested:added', field: added)
return false
Please sign in to comment.
Something went wrong with that request. Please try again.