diff --git a/app/assets/javascripts/application/learning_objects.coffee.erb b/app/assets/javascripts/application/learning_objects.coffee.erb index f779bd083637c826be3530312658df519b6fb91d..5d95b36d89c6f6da782b686bca834366772f4a1b 100644 --- a/app/assets/javascripts/application/learning_objects.coffee.erb +++ b/app/assets/javascripts/application/learning_objects.coffee.erb @@ -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 diff --git a/app/views/learning_objects/show.html.erb b/app/views/learning_objects/show.html.erb index 5ffae9548083ec41045cf363017a0a7804ce0c2a..1943859b6eec35bd903d1b9f4909c75b1fae484e 100644 --- a/app/views/learning_objects/show.html.erb +++ b/app/views/learning_objects/show.html.erb @@ -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>