diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-04-17 15:54:26 -0500 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-05-12 09:27:05 -0500 |
commit | 52accce3854df8f6258c1699aacff8d460c8048d (patch) | |
tree | cfbb14d87d149ad6c41e7258865d33d5f2966143 /app/assets | |
parent | c266b5f57a09c13feef9c066856715f339076285 (diff) | |
download | gitlab-ce-52accce3854df8f6258c1699aacff8d460c8048d.tar.gz |
Add fixed positioning to top level navbar
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/header.scss | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/layout.scss | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/nav.scss | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/sidebar.scss | 2 |
5 files changed, 12 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index a3dff25c93b..ebb217ab13a 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -353,6 +353,7 @@ import BlobForkSuggestion from './blob/blob_fork_suggestion'; initAffix() { const $tabs = $('.js-tabs-affix'); + const $fixedNav = $('.navbar-gitlab'); // Screen space on small screens is usually very sparse // So we dont affix the tabs on these @@ -371,7 +372,7 @@ import BlobForkSuggestion from './blob/blob_fork_suggestion'; .affix({ offset: { top: () => ( - $diffTabs.offset().top - $tabs.height() + $diffTabs.offset().top - $tabs.height() - $fixedNav.height() ), }, }) diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 6d9218310eb..f70f8c51bd4 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -30,6 +30,9 @@ header { background-color: $gray-light; border: none; border-bottom: 1px solid $border-color; + position: fixed; + top: 0; + width: 100%; @media (max-width: $screen-xs-min) { padding: 0 16px; diff --git a/app/assets/stylesheets/framework/layout.scss b/app/assets/stylesheets/framework/layout.scss index 20c7bc93c28..9e8acf4e73c 100644 --- a/app/assets/stylesheets/framework/layout.scss +++ b/app/assets/stylesheets/framework/layout.scss @@ -25,6 +25,10 @@ body { .content-wrapper { padding-bottom: 100px; + + &:not(.page-with-layout-nav) { + margin-top: $header-height; + } } .container { diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index b6cf5101d60..64e6ab391b6 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -291,6 +291,7 @@ border-bottom: 1px solid $border-color; transition: padding $sidebar-transition-duration; text-align: center; + margin-top: $header-height; .container-fluid { position: relative; @@ -428,7 +429,7 @@ top: ($header-height + 1) * 3; &.affix { - top: 0; + top: $header-height; } } } diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index 746c9c25620..74a9c2ccc4c 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -80,6 +80,6 @@ &.affix { position: fixed; - top: 0; + top: $header-height;; } } |