From 755397e6c9a81ab25e9df1b9f3c4c7b0842a1160 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 9 Aug 2018 03:46:17 -0500 Subject: [PATCH] comments.js: remove dead code. Remove dead and hide_threshold_comments and initialize_expand_links methods. initialize_expand_links is dead because `.comment-section` doesn't exist. --- app/javascript/src/javascripts/comments.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/app/javascript/src/javascripts/comments.js b/app/javascript/src/javascripts/comments.js index 2637b6f03..9347e24b7 100644 --- a/app/javascript/src/javascripts/comments.js +++ b/app/javascript/src/javascripts/comments.js @@ -8,7 +8,6 @@ Comment.initialize_all = function() { $(document).on("click", ".reply-link", Comment.quote); $(document).on("click", ".edit_comment_link", Comment.show_edit_form); $(document).on("click", ".expand-comment-response", Comment.show_new_comment_form); - this.initialize_expand_links(); } $(window).on("danbooru:index_for_post", (_event, post_id, current_comment_section) => { @@ -36,16 +35,6 @@ Comment.quote = function(e) { e.preventDefault(); } -Comment.initialize_expand_links = function() { - $(".comment-section form").hide(); - $(".comment-section input.expand-comment-response").click(function(e) { - var post_id = $(this).closest(".comment-section").data("post-id"); - $(this).hide(); - $(".comment-section[data-post-id=" + post_id + "] form").slideDown("fast"); - e.preventDefault(); - }); -} - Comment.show_new_comment_form = function(e) { $(e.target).hide(); var $form = $(e.target).closest("div.new-comment").find("form"); @@ -59,17 +48,6 @@ Comment.show_edit_form = function(e) { e.preventDefault(); } -Comment.hide_threshold_comments = function(post_id) { - var threshold = parseInt(Utility.meta("user-comment-threshold")); - var articles = $("article.comment[data-post-id=" + post_id + "]"); - articles.each(function(i, v) { - var $comment = $(v); - if (parseInt($comment.data("score")) < threshold) { - $comment.hide(); - } - }); -} - $(document).ready(function() { Comment.initialize_all(); });