fixes duplicate id in comment form [#21]

This commit is contained in:
rgarcia
2015-07-27 22:22:12 +02:00
parent 24924497f3
commit dea2964f08
3 changed files with 8 additions and 7 deletions

View File

@@ -1,12 +1,13 @@
jQuery ->
toggle_comment = (id) ->
$("#js-comment-form-#{id}").toggle()
toggle_comment = (id, klass) ->
$("#js-comment-form-#{id}-#{klass}").toggle()
ready = ->
$('.js-add-comment-link').click ->
id = $(this).data().id
toggle_comment(id)
klass = $(this).data().klass
toggle_comment(id, klass)
false
$(document).ready(ready)