summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-05-12 09:42:09 -0500
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-05-12 09:42:09 -0500
commitb29414dfc0b5f24c3773596eae7bb9a70275a44e (patch)
tree3687c23b6e47d1ec561eb8e7a71ff1bc06c7f330 /app/assets/javascripts
parent0278b912038b1c70f289ab915c4d0752f9aff4b0 (diff)
downloadgitlab-ce-b29414dfc0b5f24c3773596eae7bb9a70275a44e.tar.gz
Clean up fixed navbar
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/layout_nav.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/layout_nav.js b/app/assets/javascripts/layout_nav.js
index 8cc0b6d66de..71064ccc539 100644
--- a/app/assets/javascripts/layout_nav.js
+++ b/app/assets/javascripts/layout_nav.js
@@ -48,8 +48,11 @@ import _ from 'underscore';
});
function applyScrollNavClass() {
- $('.navbar-border').css('opacity', $(window).scrollTop() / 40);
+ const scrollOpacityHeight = 40;
+ $('.navbar-border').css('opacity', Math.min($(window).scrollTop() / scrollOpacityHeight, 1));
}
- $(window).scroll(_.throttle(applyScrollNavClass, 100));
+ $(() => {
+ $(window).on('scroll', _.throttle(applyScrollNavClass, 100));
+ });
}).call(window);