diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 020c103dbc525414c56c05a793ec7b0ff4df5e64..652dc29242175e4bbee629fd0a3ff382a098de0d 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -132,10 +132,9 @@ $ -> ), 1 # Initialize tooltips - $('.has_tooltip').tooltip() - - # Bottom tooltip - $('.has_bottom_tooltip').tooltip(placement: 'bottom') + $('body').tooltip({ + selector: '.has_tooltip, [data-toggle="tooltip"]' + }) # Form submitter $('.trigger-submit').on 'change', -> diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index b8f96787e763f81e95117a6ebba80a1f53c102a9..83387ad90264114781d721a79942c206fb22050c 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -2,7 +2,7 @@ .navbar-inner .container %div.app_logo - = link_to root_path, class: 'home has_bottom_tooltip', title: 'Dashboard' do + = link_to root_path, class: 'home', title: 'Dashboard', data: {toggle: 'tooltip', placement: 'bottom'} do = brand_header_logo %h3 GitLab %h1.title= title @@ -16,33 +16,33 @@ %li.hidden-sm.hidden-xs = render 'layouts/search' %li.visible-sm.visible-xs - = link_to search_path, title: 'Search', class: 'has_bottom_tooltip' do + = link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('search') %li - = link_to help_path, title: 'Help', class: 'has_bottom_tooltip' do + = link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('question-circle') %li - = link_to explore_root_path, title: 'Explore', class: 'has_bottom_tooltip' do + = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('globe') %li - = link_to user_snippets_path(current_user), title: 'Your snippets', class: 'has_bottom_tooltip' do + = link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('clipboard') - if current_user.is_admin? %li - = link_to admin_root_path, title: 'Admin area', class: 'has_bottom_tooltip' do + = link_to admin_root_path, title: 'Admin area', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('cogs') - if current_user.can_create_project? %li - = link_to new_project_path, title: 'New project', class: 'has_bottom_tooltip' do + = link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('plus') %li - = link_to profile_path, title: 'Profile settings', class: 'has_bottom_tooltip' do + = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('user') %li - = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', class: 'has_bottom_tooltip' do + = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom'} do = icon('sign-out') %li.hidden-xs - = link_to current_user, class: 'profile-pic has_bottom_tooltip', id: 'profile-pic' do + = link_to current_user, class: 'profile-pic', id: 'profile-pic', data: {toggle: 'tooltip', placement: 'bottom'} do = image_tag avatar_icon(current_user.email, 60), alt: 'User activity' = render 'shared/outdated_browser' diff --git a/app/views/profiles/update.js.erb b/app/views/profiles/update.js.erb index f3729058e76a97922562bdf49b442eef524d6d7f..fc82b45a499290a1912fab8ec073a5927cc2cb9f 100644 --- a/app/views/profiles/update.js.erb +++ b/app/views/profiles/update.js.erb @@ -4,6 +4,3 @@ $('body').addClass('<%= app_theme %> <%= theme_type %>') // Re-render the header to reflect the new theme $('header').html('<%= escape_javascript(render("layouts/head_panel", title: "Profile")) %>') - -// Re-initialize header tooltips -$('.has_bottom_tooltip').tooltip({placement: 'bottom'})