Fade out border on scroll

This commit is contained in:
Annabel Dunstone Gray 2017-05-05 14:38:49 -05:00
parent 9059b99b75
commit 94919b4724
4 changed files with 14 additions and 11 deletions

View File

@ -48,12 +48,8 @@ import _ from 'underscore';
});
function applyScrollNavClass() {
if ($(window).scrollTop() > 0) {
$('.navbar-gitlab').addClass('scroll');
} else {
$('.navbar-gitlab').removeClass('scroll');
}
$('.navbar-border').css("opacity", $(window).scrollTop() / 40);
}
$(window).scroll( _.throttle(applyScrollNavClass, 250));
$(window).scroll( _.throttle(applyScrollNavClass, 100));
}).call(window);

View File

@ -23,7 +23,6 @@ header {
}
&.navbar-gitlab {
@include transition(border-color 150ms ease-in-out);
padding: 0 16px;
z-index: 100;
margin-bottom: 0;
@ -43,10 +42,6 @@ header {
border-color: transparent;
}
&.scroll {
border-color: $border-color;
}
.container-fluid {
width: 100% !important;
filter: none;
@ -118,6 +113,16 @@ header {
}
}
.navbar-border {
height: 1px;
position: fixed;
left: 0;
right: 0;
top: 50px;
background-color: $border-color;
opacity: 0;
}
.global-dropdown {
position: absolute;
left: -10px;

View File

@ -1,4 +1,5 @@
%header.navbar.navbar-gitlab{ class: nav_header_class }
.navbar-border
%a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
.container-fluid
.header-content

View File

@ -4,6 +4,7 @@
= page_specific_javascript_bundle_tag('sidebar')
%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix" }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
.issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } }
- can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.block.issuable-sidebar-header
- if current_user