diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee index a1635b42c..b40da3485 100644 --- a/app/assets/javascripts/comments.js.coffee +++ b/app/assets/javascripts/comments.js.coffee @@ -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 \ No newline at end of file + ready = -> + $('.js-add-comment-link').click -> + id = $(this).data().id + toggle_comment(id) + false + + $(document).ready(ready) + $(document).on('page:load', ready) \ No newline at end of file