mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 08:06:08 +10:00
Place the logo's tooltip dynamically
When collapsed it's on the right like everything else, when expanded it's on the bottom.
This commit is contained in:
@@ -134,6 +134,14 @@ $ ->
|
|||||||
# Initialize tooltips
|
# Initialize tooltips
|
||||||
$('body').tooltip({
|
$('body').tooltip({
|
||||||
selector: '.has_tooltip, [data-toggle="tooltip"], .page-sidebar-collapsed .nav-sidebar a'
|
selector: '.has_tooltip, [data-toggle="tooltip"], .page-sidebar-collapsed .nav-sidebar a'
|
||||||
|
placement: (_, el) ->
|
||||||
|
$el = $(el)
|
||||||
|
if $el.attr('id') == 'js-shortcuts-home'
|
||||||
|
# Place the logo tooltip on the right when collapsed, bottom when expanded
|
||||||
|
$el.parents('header').hasClass('header-collapsed') and 'right' or 'bottom'
|
||||||
|
else
|
||||||
|
# Otherwise use the data-placement attribute like normal
|
||||||
|
$el.data('placement')
|
||||||
})
|
})
|
||||||
|
|
||||||
# Form submitter
|
# Form submitter
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
.navbar-inner
|
.navbar-inner
|
||||||
.container
|
.container
|
||||||
%div.app_logo
|
%div.app_logo
|
||||||
= link_to root_path, class: 'home', title: 'Dashboard', data: {toggle: 'tooltip', placement: 'bottom'} do
|
= link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do
|
||||||
= brand_header_logo
|
= brand_header_logo
|
||||||
%h3 GitLab
|
%h3 GitLab
|
||||||
%h1.title= title
|
%h1.title= title
|
||||||
|
|||||||
Reference in New Issue
Block a user