Permalink
Browse files

Fix heart not turning red when liking a trick

  • Loading branch information...
1 parent c852052 commit 37c25372ea29c058525a367e41ac978188086f3c @stidges stidges committed Feb 27, 2014
Showing with 4 additions and 4 deletions.
  1. +1 −1 app/views/tricks/single.blade.php
  2. +3 −3 public/js/trick-like-backup.js
@@ -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
@@ -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');
@@ -30,4 +30,4 @@
});
});
-})(jQuery)
+})(jQuery)

0 comments on commit 37c2537

Please sign in to comment.