Use App.Comments module in create.js.erb

This commit is contained in:
kikito
2015-07-30 14:08:05 +02:00
parent 1237f9d8ad
commit 59cea45c26
2 changed files with 11 additions and 5 deletions

View File

@@ -1,6 +1,13 @@
App.Comments =
add_response: (parent_id, response_html) ->
$(response_html).insertAfter($("#js-comment-form-#{parent_id}"))
reset_and_hide_form: (id) ->
form = $("#js-comment-form-#{id}")
form.val('')
form.hide()
toggle_form: (id) ->
$("#js-comment-form-#{id}").toggle()