fixes #1343
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
if ($("#c-posts").length && $("#a-show").length) {
|
||||
this.initialize_links();
|
||||
this.initialize_favlist();
|
||||
this.initialize_post_sections();
|
||||
this.initialize_post_image_resize_links();
|
||||
this.initialize_post_image_resize_to_window_link();
|
||||
@@ -134,6 +135,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.Post.initialize_favlist = function() {
|
||||
$("#favlist").hide();
|
||||
$("#hide-favlist-link").hide();
|
||||
|
||||
$("#show-favlist-link").click(function(e) {
|
||||
$("#favlist").show();
|
||||
$(this).hide();
|
||||
$("#hide-favlist-link").show();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#hide-favlist-link").click(function(e) {
|
||||
$("#favlist").hide();
|
||||
$(this).hide();
|
||||
$("#show-favlist-link").show();
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.Post.initialize_titles = function() {
|
||||
$(".post-preview").each(function(i, v) {
|
||||
Danbooru.Post.initialize_title_for(v);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<br><%= post.favorited_users.reverse_each.map{|user| link_to_user(user)}.join(", ").html_safe %>
|
||||
<%= post.favorited_users.reverse_each.map{|user| link_to_user(user)}.join(", ").html_safe %>
|
||||
@@ -1 +1,3 @@
|
||||
$("span#favlist-for-post-<%= @post.id %>").html("<%= j(render(:partial => "favorites/favorited_users_list", :locals => { :post => @post }))%>");
|
||||
$("#favlist").html("<%= j(render(:partial => "favorites/favorited_users_list", :locals => { :post => @post }))%>");
|
||||
|
||||
$("#show-favlist-link").attr("href", "#").removeAttr("data-remote");
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
<li>Source: <%= post_source_tag(post) %></li>
|
||||
<li>Rating: <%= post.pretty_rating %></li>
|
||||
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_privileged? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
|
||||
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span> <% if CurrentUser.is_privileged? && post.fav_count > 0 %><span id="favlist-for-post-<%= post.id %>"><%= link_to "»".html_safe, favorites_path(:post_id => post.id), :remote => true %></span><% end %></li>
|
||||
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
||||
<% if CurrentUser.is_privileged? && post.fav_count > 0 %>
|
||||
<%= link_to "»".html_safe, favorites_path(:post_id => post.id), :remote => true, :id => "show-favlist-link" %>
|
||||
<%= link_to "«".html_safe, "#", :id => "hide-favlist-link" %>
|
||||
<div id="favlist" style="margin-left:1.5em; word-wrap:break-word"></div>
|
||||
<% end %></li>
|
||||
<li>
|
||||
Status:
|
||||
<% if post.is_pending? %>
|
||||
|
||||
Reference in New Issue
Block a user