fixes #4050
This commit is contained in:
@@ -149,6 +149,18 @@ body[data-user-can-approve-posts="true"] .post-preview {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes heartbeat {
|
||||||
|
0% {
|
||||||
|
transform:scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform:scale(1.3);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform:scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
div#c-posts {
|
div#c-posts {
|
||||||
.fav-buttons {
|
.fav-buttons {
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
@@ -163,10 +175,14 @@ div#c-posts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#remove-fav-button i {
|
#remove-fav-button i.fa-heart {
|
||||||
color: deeppink;
|
color: deeppink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#remove-fav-button.animate i {
|
||||||
|
animation: heartbeat 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
.fav-buttons-true #add-fav-button {
|
.fav-buttons-true #add-fav-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle();
|
$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle();
|
||||||
|
$("#remove-fav-button").addClass("animate");
|
||||||
|
$.timeout(30000, function() {
|
||||||
|
$("#remove-fav-button").removeClass("animate");
|
||||||
|
});
|
||||||
$("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
|
$("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
|
||||||
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
|
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
|
||||||
$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true");
|
$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true");
|
||||||
|
|||||||
@@ -56,11 +56,11 @@
|
|||||||
<% if CurrentUser.is_member? %>
|
<% if CurrentUser.is_member? %>
|
||||||
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
|
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
|
||||||
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
|
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
|
||||||
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "..." %>
|
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
|
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
|
||||||
<%= button_tag tag.i(class: "fas fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "..." %>
|
<%= button_tag tag.i(class: "fas fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user