From abe8b9c07137a563a2b210df9c80551d540052ff Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 8 Aug 2018 23:44:35 -0500 Subject: [PATCH] Fix "Show all comments" link. The second argument to `trigger` is supposed to be an array. ref: https://danbooru.donmai.us/forum_topics/9127?page=250#forum_post_149379 --- app/javascript/src/javascripts/comments.js | 2 +- app/views/comments/index_for_post.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/src/javascripts/comments.js b/app/javascript/src/javascripts/comments.js index 544eaad91..7131d8393 100644 --- a/app/javascript/src/javascripts/comments.js +++ b/app/javascript/src/javascripts/comments.js @@ -19,7 +19,7 @@ Comment.initialize_all = function() { Comment.highlight_threshold_comments(Utility.meta("post-id")); } - $(window).on("danbooru:index_for_post", (post_id, current_comment_section, include_below_threshold) => { + $(window).on("danbooru:index_for_post", (_event, post_id, current_comment_section, include_below_threshold) => { if (include_below_threshold) { $("#threshold-comments-notice-for-" + post_id).hide(); } else { diff --git a/app/views/comments/index_for_post.js.erb b/app/views/comments/index_for_post.js.erb index 37bb6f687..a58fd7168 100644 --- a/app/views/comments/index_for_post.js.erb +++ b/app/views/comments/index_for_post.js.erb @@ -2,4 +2,4 @@ $("#hidden-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, <%= ActiveModel::Type::Boolean.new.cast(params[:include_below_threshold]) %>); +$(window).trigger("danbooru:index_for_post", [<%= @post.id %>, current_comment_section, <%= ActiveModel::Type::Boolean.new.cast(params[:include_below_threshold]) %>]);