diff options
| author | Zog | 2018-02-23 15:50:41 +0100 |
|---|---|---|
| committer | Zog | 2018-02-23 15:50:41 +0100 |
| commit | 2b5a9ad56ee55fe8153eed8e14c44bfa7fe21c3b (patch) | |
| tree | 2d3b7c3816e76579b1500c046d0d8a7cc15282cf /app/assets | |
| parent | 206bf218e1b84dbe53683ec2e3f983cd30f7ded1 (diff) | |
| download | chouette-core-2b5a9ad56ee55fe8153eed8e14c44bfa7fe21c3b.tar.bz2 | |
Refs #5952; Add an hysteresis on the sticky header
Diffstat (limited to 'app/assets')
| -rw-r--r-- | app/assets/javascripts/main_menu.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/main_menu.coffee b/app/assets/javascripts/main_menu.coffee index e943f448a..22ecebd25 100644 --- a/app/assets/javascripts/main_menu.coffee +++ b/app/assets/javascripts/main_menu.coffee @@ -21,8 +21,9 @@ $ -> sticker = () -> limit = 51 + offset = 30 - if $(window).scrollTop() >= limit + if $(window).scrollTop() >= limit + offset if stickyActions.length == 0 if ($('.page-action .small').length > 0) stickyActions.push @@ -53,7 +54,7 @@ $ -> for child in item.content child.appendTo $('.sticky-paction') - else + else if $(window).scrollTop() <= limit - offset $('#main_nav').removeClass 'sticky' if $('#menu_top').find('.sticky-content').length > 0 |
