Commit e8faf917 authored by Robert Speicher's avatar Robert Speicher

Remove the `has_bottom_tooltip` class

Bootstrap's tooltip JS can read the placement from a `data-placement`
attribute.

Further, when we supply the `selector` option to `tooltip`, tooltips
will be added to any dynamically-added elements matching the selector,
without us having to re-call the `tooltip` method.
parent c597b5d0
...@@ -132,10 +132,9 @@ $ -> ...@@ -132,10 +132,9 @@ $ ->
), 1 ), 1
# Initialize tooltips # Initialize tooltips
$('.has_tooltip').tooltip() $('body').tooltip({
selector: '.has_tooltip, [data-toggle="tooltip"]'
# Bottom tooltip })
$('.has_bottom_tooltip').tooltip(placement: 'bottom')
# Form submitter # Form submitter
$('.trigger-submit').on 'change', -> $('.trigger-submit').on 'change', ->
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.navbar-inner .navbar-inner
.container .container
%div.app_logo %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 = brand_header_logo
%h3 GitLab %h3 GitLab
%h1.title= title %h1.title= title
...@@ -16,33 +16,33 @@ ...@@ -16,33 +16,33 @@
%li.hidden-sm.hidden-xs %li.hidden-sm.hidden-xs
= render 'layouts/search' = render 'layouts/search'
%li.visible-sm.visible-xs %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') = icon('search')
%li %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') = icon('question-circle')
%li %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') = icon('globe')
%li %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') = icon('clipboard')
- if current_user.is_admin? - if current_user.is_admin?
%li %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') = icon('cogs')
- if current_user.can_create_project? - if current_user.can_create_project?
%li %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') = icon('plus')
%li %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') = icon('user')
%li %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') = icon('sign-out')
%li.hidden-xs %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' = image_tag avatar_icon(current_user.email, 60), alt: 'User activity'
= render 'shared/outdated_browser' = render 'shared/outdated_browser'
...@@ -4,6 +4,3 @@ $('body').addClass('<%= app_theme %> <%= theme_type %>') ...@@ -4,6 +4,3 @@ $('body').addClass('<%= app_theme %> <%= theme_type %>')
// Re-render the header to reflect the new theme // Re-render the header to reflect the new theme
$('header').html('<%= escape_javascript(render("layouts/head_panel", title: "Profile")) %>') $('header').html('<%= escape_javascript(render("layouts/head_panel", title: "Profile")) %>')
// Re-initialize header tooltips
$('.has_bottom_tooltip').tooltip({placement: 'bottom'})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment