From ce5675ce930e98391460974e65936e80798fbd0b Mon Sep 17 00:00:00 2001 From: Mateus Rambo Strey <mars11@inf.ufpr.br> Date: Thu, 22 Oct 2015 10:31:11 -0200 Subject: [PATCH] add tooltip to learning object --- app/assets/javascripts/application.js | 4 ++++ app/assets/javascripts/application/search.js | 3 +++ app/views/learning_objects/_learning_object_horizontal.erb | 4 ++-- app/views/learning_objects/_learning_object_vertical.erb | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 040ebed4..9758003e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,3 +20,7 @@ //= require jquery.turbolinks //= require turbolinks //= require_tree ./application + +$(document).ready(function () { + $('[data-toggle="tooltip"]').tooltip(); +}); diff --git a/app/assets/javascripts/application/search.js b/app/assets/javascripts/application/search.js index d6636b18..2f9c50e9 100644 --- a/app/assets/javascripts/application/search.js +++ b/app/assets/javascripts/application/search.js @@ -43,6 +43,9 @@ var search = function() { $("#search-fetch").append(data); + // add tooltip + $('[data-toggle="tooltip"]').tooltip(); + searchWatchers().attachMoreResults(); }); } diff --git a/app/views/learning_objects/_learning_object_horizontal.erb b/app/views/learning_objects/_learning_object_horizontal.erb index ad258652..db10f2ae 100644 --- a/app/views/learning_objects/_learning_object_horizontal.erb +++ b/app/views/learning_objects/_learning_object_horizontal.erb @@ -18,8 +18,8 @@ <% end %> <span class="author-label">Por <%= learning_object.get_metadata_value_of("dc.contributor.author") %></span><br/> - <span class="glyphicon glyphicon-eye-open"><%= learning_object.views %></span> - <span class="glyphicon glyphicon-star votes-count" data-id="<%= learning_object.id %>"><%= learning_object.likes %></span><br> + <span class="glyphicon glyphicon-eye-open" data-toggle="tooltip" data-placement="bottom" title="Visualizações"><%= learning_object.views %></span> + <span class="glyphicon glyphicon-star votes-count" data-id="<%= learning_object.id %>" data-toggle="tooltip" data-placement="bottom" title="Curtidas"><%= learning_object.likes %></span><br> <% unless learning_object.description.nil? %> <div class="learning-object-text"> diff --git a/app/views/learning_objects/_learning_object_vertical.erb b/app/views/learning_objects/_learning_object_vertical.erb index e6241383..3fbb3521 100644 --- a/app/views/learning_objects/_learning_object_vertical.erb +++ b/app/views/learning_objects/_learning_object_vertical.erb @@ -10,9 +10,9 @@ </div> <div class="panel-body"> <h4 class="media-heading"><%= learning_object_title(learning_object) %></h4> - <span class="glyphicon glyphicon-eye-open"><%= learning_object.views %></span> - <span class="glyphicon glyphicon-star votes-count" data-id="<%= learning_object.id %>"><%= learning_object.likes %></span> + <span class="glyphicon glyphicon-eye-open" data-toggle="tooltip" data-placement="bottom" title="Visualizações"><%= learning_object.views %></span> + <span class="glyphicon glyphicon-star votes-count" data-id="<%= learning_object.id %>" data-toggle="tooltip" data-placement="bottom" title="Curtidas"><%= learning_object.likes %></span> <span class="author-label">Por <%= learning_object.get_metadata_value_of("dc.contributor.author") %></span> </div> </div> -</div> \ No newline at end of file +</div> -- GitLab