mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 09:17:20 -04:00
Use our own class to indicate liked
This commit is contained in:
@@ -24,13 +24,13 @@ $(document).ready(function() {
|
||||
|
||||
$('#photo-' + data.id + ' .like-count').text(data.like_count);
|
||||
if (data.liked_by_member) {
|
||||
like_badge.addClass('text-success');
|
||||
like_badge.addClass('liked');
|
||||
// Turn the button into an unlike button
|
||||
like_button.data('method', 'delete');
|
||||
like_button.attr('href', data.url);
|
||||
like_button.text('Unlike');
|
||||
} else {
|
||||
like_badge.removeClass('text-success');
|
||||
like_badge.removeClass('liked');
|
||||
// Turn the button into an *like* button
|
||||
like_button.data('method', 'post');
|
||||
like_button.attr('href', '/likes.json?photo_id=' + data.id);
|
||||
|
||||
4
app/assets/stylesheets/_likes.scss
Normal file
4
app/assets/stylesheets/_likes.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
.liked {
|
||||
background-color: $white;
|
||||
color: $red;
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
@import 'overrides';
|
||||
@import 'crops';
|
||||
@import 'harvests';
|
||||
@import 'likes';
|
||||
@import 'members';
|
||||
@import 'notifications';
|
||||
@import 'plantings';
|
||||
|
||||
Reference in New Issue
Block a user