diff options
| author | teddywing | 2018-03-02 17:33:14 +0100 | 
|---|---|---|
| committer | GitHub | 2018-03-02 17:33:14 +0100 | 
| commit | 6c4063c9e37e0afd3c3c4e980144aa54710062a7 (patch) | |
| tree | c40756c842428c3e007ff77e4fd44b8636a8db32 | |
| parent | 79ea2558afd9930afcee4378326f14b7c2adaecf (diff) | |
| parent | 2b5a9ad56ee55fe8153eed8e14c44bfa7fe21c3b (diff) | |
| download | chouette-core-6c4063c9e37e0afd3c3c4e980144aa54710062a7.tar.bz2 | |
Merge pull request #338 from af83/5952-fix-sticky-header-behaviour
5952 Add an hysteresis on the sticky header
| -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 | 
