From 766d68c4eea31744f30df67ed0e98913b6ea8697 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 14 Aug 2018 16:00:33 -0500 Subject: [PATCH] posts/show: fix flickering post unvote link. --- app/javascript/src/javascripts/posts.js.erb | 2 -- app/views/posts/partials/show/_information.html.erb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js.erb b/app/javascript/src/javascripts/posts.js.erb index c9f7da575..38df3b3da 100644 --- a/app/javascript/src/javascripts/posts.js.erb +++ b/app/javascript/src/javascripts/posts.js.erb @@ -274,8 +274,6 @@ Post.initialize_links = function() { e.preventDefault(); }); - - $(".unvote-post-link").hide(); } Post.initialize_post_relationship_previews = function() { diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb index 4eff6d98c..7c87fc524 100644 --- a/app/views/posts/partials/show/_information.html.erb +++ b/app/views/posts/partials/show/_information.html.erb @@ -19,7 +19,7 @@
  • Source: <%= post_source_tag(post) %>
  • Rating: <%= post.pretty_rating %>
  • -
  • Score: <%= post.score %> <% if CurrentUser.is_voter? %>(vote <%= link_to content_tag("i", nil, class: "far fa-thumbs-up"), post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %> <%= link_to content_tag("i", nil, class: "far fa-thumbs-down"), post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %><%= link_to "undo vote", post_votes_path(post), :remote => true, :method => :delete, :id => "unvote-link-for-post-#{post.id}", :class => "unvote-post-link" %>)<% end %>
  • +
  • Score: <%= post.score %> <% if CurrentUser.is_voter? %>(vote <%= link_to content_tag("i", nil, class: "far fa-thumbs-up"), post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %> <%= link_to content_tag("i", nil, class: "far fa-thumbs-down"), post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %><%= link_to "undo vote", post_votes_path(post), :remote => true, :method => :delete, :id => "unvote-link-for-post-#{post.id}", :class => "unvote-post-link", :style => "display: none;" %>)<% end %>
  • Favorites: <%= post.fav_count %> <% if CurrentUser.is_gold? %> <%= link_to "Show ยป", "#", id: "show-favlist-link", style: ("display: none;" if post.fav_count == 0) %>