This commit is contained in:
David Gil
2015-08-11 18:05:12 +02:00
parent d86eb9f550
commit 9d2bece0b3
4 changed files with 22 additions and 10 deletions

View File

@@ -4,10 +4,15 @@ App.Comments =
$(response_html).insertAfter($("#js-comment-form-#{parent_id}"))
reset_and_hide_form: (id) ->
form = $("#js-comment-form-#{id}")
form.val('')
form = $("#js-comment-form-#{id} form")
input = form.find("textarea")
input.val('')
form.hide()
reset_form: (id) ->
input = $("#js-comment-form-#{id} form textarea")
input.val('')
toggle_form: (id) ->
$("#js-comment-form-#{id}").toggle()
@@ -16,5 +21,3 @@ App.Comments =
id = $(this).data().id
App.Comments.toggle_form(id)
false