selectors_for_tooltip.patch

Marius BALTEANU, 2019-08-04 23:00

Download (1.76 KB)

View differences:

app/helpers/application_helper.rb
617 617
  def time_tag(time)
618 618
    text = distance_of_time_in_words(Time.now, time)
619 619
    if @project
620
      link_to(text, project_activity_path(@project, :from => User.current.time_to_date(time)), :title => format_time(time))
620
      link_to(text, project_activity_path(@project, :from => User.current.time_to_date(time)), :title => format_time(time), :data => {:toggle => 'tooltip'})
621 621
    else
622 622
      content_tag('abbr', text, :title => format_time(time))
623 623
    end
app/helpers/avatars_helper.rb
38 38
  # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
39 39
  def avatar(user, options = { })
40 40
    if Setting.gravatar_enabled?
41
      options.merge!(:default => Setting.gravatar_default)
41
      options.merge!(:default => Setting.gravatar_default, :data => {:toggle => 'tooltip'})
42 42
      options[:class] = GravatarHelper::DEFAULT_OPTIONS[:class] + " " + options[:class] if options[:class]
43 43
      email = nil
44 44
      if user.respond_to?(:mail)
public/javascripts/application.js
996 996
}
997 997

  
998 998
$(function () {
999
    $('[title]').tooltip({
999
    $('[data-toggle="tooltip"], .icon-only').tooltip({
1000 1000
        show: {
1001 1001
          delay: 400
1002 1002
        },