Merge branch 'master' into home
This commit is contained in:
@@ -3,7 +3,11 @@ jQuery ->
|
||||
toggle_comment = (id) ->
|
||||
$("#js-comment-form-#{id}").toggle()
|
||||
|
||||
$('.js-add-comment-link').click ->
|
||||
id = $(this).data().id
|
||||
toggle_comment(id)
|
||||
false
|
||||
ready = ->
|
||||
$('.js-add-comment-link').click ->
|
||||
id = $(this).data().id
|
||||
toggle_comment(id)
|
||||
false
|
||||
|
||||
$(document).ready(ready)
|
||||
$(document).on('page:load', ready)
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= link_to comment_link_text(parent), "", class: "js-add-comment-link", data: {'id': parent.id} %>
|
||||
<%= link_to comment_link_text(parent), "", class: "js-add-comment-link", data: {'id': dom_id(parent)} %>
|
||||
|
||||
<div id="js-comment-form-<%= parent.id %>" style="display:none">
|
||||
<div id="js-comment-form-<%= dom_id(parent) %>" style="display:none">
|
||||
<%= form_for [@debate, Comment.new] do |f| %>
|
||||
<%= f.text_area :body %>
|
||||
<%= f.hidden_field :commentable_type, value: parent.class %>
|
||||
|
||||
Reference in New Issue
Block a user