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.
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user