diff options
Diffstat (limited to 'app/assets/javascripts/main')
-rw-r--r-- | app/assets/javascripts/main/comments.coffee | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/main/comments.coffee b/app/assets/javascripts/main/comments.coffee new file mode 100644 index 0000000..d33e200 --- /dev/null +++ b/app/assets/javascripts/main/comments.coffee | |||
@@ -0,0 +1,14 @@ | |||
1 | comments_ready = -> | ||
2 | $(".comment-reply-to").click -> | ||
3 | $("#comment_reply_to_id").val($(this).data("commentId")) | ||
4 | $("#comment-reply-msg .comment-reply-author").text($(this).data("commentAuthor")) | ||
5 | $("#comment-reply-msg").show() | ||
6 | return false | ||
7 | |||
8 | $(".comment-reply-cancel").click -> | ||
9 | $("#comment_reply_to_id").val("") | ||
10 | $("#comment-reply-msg").hide() | ||
11 | return false | ||
12 | |||
13 | $(document).ready(comments_ready) | ||
14 | $(document).on('turbolinks:load', comments_ready) | ||