favorites: unify create.js.erb & destory.js.erb code paths.

This commit is contained in:
evazion
2018-08-12 15:49:13 -05:00
parent fb91bbc6c5
commit bcaee199f5
4 changed files with 20 additions and 26 deletions

View File

@@ -1,13 +0,0 @@
$("#add-to-favorites").hide();
$("#add-fav-button").hide();
$("#remove-from-favorites").show();
$("#remove-fav-button").show();
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
<% if CurrentUser.is_gold? %>
$("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
if (!$("#favlist").is(":visible")) {
$("#show-favlist-link").show();
}
<% end %>
$(window).trigger("danbooru:notice", "You have favorited this post");

View File

@@ -0,0 +1 @@
_update.js.erb