diff options
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/application.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/main/comments.coffee | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index cd58a9c..d8f72b4 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js | |||
@@ -17,3 +17,4 @@ | |||
17 | //= require jquery-ui | 17 | //= require jquery-ui |
18 | //= require js-routes | 18 | //= require js-routes |
19 | //= require_tree ./admin | 19 | //= require_tree ./admin |
20 | //= require_tree ./main | ||
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) | ||