diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
commit | fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd (patch) | |
tree | 27d42a442c000781d100dfa7fd8b976aefb03c31 /app/assets/javascripts/main/comments.coffee | |
parent | 0aace2986a9a7a6d4c84a9ba6819d3df7821e267 (diff) | |
download | thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.gz thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.bz2 thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.zip |
Added comment replying
Diffstat (limited to 'app/assets/javascripts/main/comments.coffee')
-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) | ||