Fix #4593: Shift + F shortcut not working correctly.
Fix it being possible to use Shift+F to unfavorite a post that is already not favorited.
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
<%= link_to "Favorite", favorites_path(post_id: post.id), remote: true, method: :post, id: "add-to-favorites", "data-shortcut": "f", style: ("display: none;" if @post.is_favorited?) %>
|
<%= link_to "Favorite", favorites_path(post_id: post.id), remote: true, method: :post, id: "add-to-favorites", "data-shortcut": "f", style: ("display: none;" if @post.is_favorited?) %>
|
||||||
</li>
|
</li>
|
||||||
<li id="post-option-remove-from-favorites">
|
<li id="post-option-remove-from-favorites">
|
||||||
<%= link_to "Unfavorite", favorite_path(post), remote: true, method: :delete, id: "remove-from-favorites", "data-shortcut": "shift+f", style: ("display: none;" if !@post.is_favorited?) %>
|
<%= link_to "Unfavorite", favorite_path(post), remote: true, method: :delete, id: "remove-from-favorites", "data-shortcut": "shift+f", "data-shortcut-when": ":visible", style: ("display: none;" if !@post.is_favorited?) %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if policy(post).update? %>
|
<% if policy(post).update? %>
|
||||||
|
|||||||
Reference in New Issue
Block a user