Files
danbooru/app/views/favorites/_update.js.erb
evazion e000bdb861 js: drop jquery-timeout plugin.
Replace with `Danbooru.Utility.delay`.
2019-08-14 01:46:44 -05:00

19 lines
724 B
Plaintext

$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle();
$("#remove-fav-button").addClass("animate");
$("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true");
<% if CurrentUser.is_gold? %>
var fav_count = <%= @post.fav_count %>;
$("#favlist").html("<%= j post_favlist(@post) %>");
if (fav_count === 0) {
$("#show-favlist-link, #hide-favlist-link, #favlist").hide();
} else if (!$("#favlist").is(":visible")) {
$("#show-favlist-link").show();
}
<% end %>
Danbooru.Utility.notice("<%= j flash[:notice] %>");