diff --git a/app/javascript/src/javascripts/comments.js b/app/javascript/src/javascripts/comments.js index 9d67427b7..50ad6a19a 100644 --- a/app/javascript/src/javascripts/comments.js +++ b/app/javascript/src/javascripts/comments.js @@ -1,5 +1,3 @@ -import Dtext from './dtext' - let Comment = {}; Comment.initialize_all = function() { @@ -8,10 +6,6 @@ Comment.initialize_all = function() { $(document).on("click.danbooru.comment", ".edit_comment_link", Comment.show_edit_form); $(document).on("click.danbooru.comment", ".expand-comment-response", Comment.show_new_comment_form); } - - $(window).on("danbooru:index_for_post", (_event, post_id, current_comment_section) => { - $("#threshold-comments-notice-for-" + post_id).hide(); - }); } Comment.quote = function(e) { diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb deleted file mode 100644 index b1c6692c8..000000000 --- a/app/views/comments/create.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("div.comments-for-post[data-post-id=<%= @comment.post_id %>] div.list-of-comments").append("<%= escape_javascript(render('comments/partials/show/comment', :comment => @comment)) %>"); diff --git a/app/views/comments/index_for_post.js.erb b/app/views/comments/index_for_post.js.erb index 7cea35603..504ac10c1 100644 --- a/app/views/comments/index_for_post.js.erb +++ b/app/views/comments/index_for_post.js.erb @@ -1,5 +1,5 @@ -$("#hidden-comments-notice-for-<%= @post.id %>").hide(); +$("#threshold-comments-notice-for-<%= @post.id %>").hide(); var current_comment_section = $("div.comments-for-post[data-post-id=<%= @post.id %>] div.list-of-comments"); current_comment_section.html("<%= j(render(:partial => 'comments/partials/show/comment', :collection => @comments))%>"); -$(window).trigger("danbooru:index_for_post", [<%= @post.id %>, current_comment_section]); +$(window).trigger("danbooru:index_for_post", [<%= @post.id %>]);