Skip to content

Commit

Permalink
Fix heart not turning red when liking a trick
Browse files Browse the repository at this point in the history
  • Loading branch information
stidges committed Feb 27, 2014
1 parent c852052 commit 37c2537
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/tricks/single.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</script>
@if(Auth::check())
<script>
(function(e){e(".js-like-trick").click(function(t){t.preventDefault();var n=e(this).data("liked")=="0";var r={_token:"{{ csrf_token() }}"};e.post('{{ route("tricks.like", $trick->slug) }}',r,function(t){if(t!="error"){if(!n){e(".js-like-trick .fa").removeClass("text-red");e(".js-like-trick").data("liked","0");e(".js-like-status").html("Like this?")}else{e(".js-like-trick .fa").addClass("text-red");e(".js-like-trick").data("liked","1");e(".js-like-status").html("You like this")}e(".js-like-count").html(t+" likes")}})})})(jQuery)
(function(e){e(".js-like-trick").click(function(t){t.preventDefault();var n=e(this).data("liked")=="0";var r={_token:"{{ csrf_token() }}"};e.post('{{ route("tricks.like", $trick->slug) }}',r,function(t){if(t!="error"){if(!n){e(".js-like-trick .fa").removeClass("text-primary");e(".js-like-trick").data("liked","0");e(".js-like-status").html("Like this?")}else{e(".js-like-trick .fa").addClass("text-primary");e(".js-like-trick").data("liked","1");e(".js-like-status").html("You like this")}e(".js-like-count").html(t+" likes")}})})})(jQuery)
</script>
@endif
@stop
Expand Down
6 changes: 3 additions & 3 deletions public/js/trick-like-backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

if (!liked) {

$('.js-like-trick .fa').removeClass('text-red');
$('.js-like-trick .fa').removeClass('text-primary');

$('.js-like-trick').data('liked', '0');

$('.js-like-status').html('Like this?');
} else {

$('.js-like-trick .fa').addClass('text-red');
$('.js-like-trick .fa').addClass('text-primary');

$('.js-like-trick').data('liked', '1');

Expand All @@ -30,4 +30,4 @@
});

});
})(jQuery)
})(jQuery)

0 comments on commit 37c2537

Please sign in to comment.