Skip to content
Snippets Groups Projects
Commit 435b1e48 authored by Giovanne Marcelo's avatar Giovanne Marcelo
Browse files

Fixing like button

parent 9ad003a8
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,10 @@ $ ->
$(document).on 'ajax:success', 'a.vote', (status, data, xhr) ->
$('.votes-count[data-id=\'' + data.id + '\']').text data.count
if $('.vote img').attr('alt') == 'Descurtir'
$('.vote img').attr('src',"<%= image_path('icons/btn_like_down.png') %>")
$('.vote img').attr('alt', 'Curtir')
else if $('.vote img').attr('alt') == 'Curtir'
$('.vote img').attr('src',"<%= image_path('icons/btn_like_up.png') %>")
$('.vote img').attr('alt', 'Descurtir')
$('.vote img').attr('alt', 'Curtir').reload()
else if $('.vote img').attr('alt') == 'Curtir'
$('.vote img').attr('src',"<%= image_path('icons/btn_like_down.png') %>")
$('.vote img').attr('alt', 'Descurtir').reload()
return
return
......@@ -68,9 +68,9 @@
<div class="action">
<%= link_to like_learning_object_path(id: @learning_object.id), class: 'vote btn btn-primary',method: :post, remote: true do %>
<% if @liked %>
<%= image_tag "icons/btn_like_up.png", alt: "Descurtir" %>
<%= image_tag "icons/btn_like_down.png", alt: "Descurtir" %>
<% else %>
<%= image_tag "icons/btn_like_down.png", alt: "Curtir" %>
<%= image_tag "icons/btn_like_up.png", alt: "Curtir" %>
<% end %>
<% end %>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment