diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-08-23 13:18:11 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-08-23 13:18:11 +0300 |
commit | 1f456ff3649e0a26785aaddf979bb8ce0d56f17a (patch) | |
tree | dfd84b8c992fb89c4c92d8b9a80149feb492c08f /app | |
parent | 8e27c3db443de317f5bbea67ba4ed98641bbd7eb (diff) | |
parent | ee22930044a997d112edf5f725096d73f3d29749 (diff) |
Merge branch 'remove-tooltip-filtered-search-user' into 'master'
Remove tooltip from filtered search user
Closes #36696
See merge request !13752
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/avatars_helper.rb | 11 | ||||
-rw-r--r-- | app/views/shared/issuable/_user_dropdown_item.html.haml | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 4b51269533c..a4c226a6aad 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -12,11 +12,18 @@ module AvatarsHelper avatar_size = options[:size] || 16 user_name = options[:user].try(:name) || options[:user_name] avatar_url = options[:url] || avatar_icon(options[:user] || options[:user_email], avatar_size) - data_attributes = { container: 'body' } + has_tooltip = options[:has_tooltip].nil? ? true : options[:has_tooltip] + data_attributes = {} + css_class = %W[avatar s#{avatar_size}].push(*options[:css_class]) + + if has_tooltip + css_class.push('has-tooltip') + data_attributes = { container: 'body' } + end image_tag( avatar_url, - class: %W[avatar has-tooltip s#{avatar_size}].push(*options[:css_class]), + class: css_class, alt: "#{user_name}'s avatar", title: user_name, data: data_attributes, diff --git a/app/views/shared/issuable/_user_dropdown_item.html.haml b/app/views/shared/issuable/_user_dropdown_item.html.haml index c18e4975bb8..48d04678d47 100644 --- a/app/views/shared/issuable/_user_dropdown_item.html.haml +++ b/app/views/shared/issuable/_user_dropdown_item.html.haml @@ -4,7 +4,7 @@ %li.filter-dropdown-item{ class: ('js-current-user' if user == current_user) } %button.btn.btn-link.dropdown-user{ type: :button } .avatar-container.s40 - = user_avatar_without_link(user: user, lazy: avatar[:lazy], url: avatar[:url], size: 40).gsub('/images/{{avatar_url}}','{{avatar_url}}').html_safe + = user_avatar_without_link(user: user, lazy: avatar[:lazy], url: avatar[:url], size: 40, has_tooltip: false).gsub('/images/{{avatar_url}}','{{avatar_url}}').html_safe .dropdown-user-details %span = user.name |