]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix bug when having scrolltop=false, sticky top bar 7631/head
authorSylvio <sylvain@com-ocean.com>
Sat, 19 Dec 2015 11:02:51 +0000 (12:02 +0100)
committerSylvio <sylvain@com-ocean.com>
Sat, 19 Dec 2015 11:02:51 +0000 (12:02 +0100)
Context :
- scrolltop option disabled
- sticky topbar
- topbar positionned not on the top of the page (ex: under a header, 100px from the top)

Bug : on small resolution, when clicking on the menu, the topbar is fixed top the top (class "fixed") and move to the top of the page instead of keeping its original position.

Resolution: The fixed class should not be enabled if the user don't scroll enough to have the top bar positionned at the top of the page.

js/foundation/foundation.topbar.js

index 51eb03de535ef712f291ff47eb0f9019a88bca32..507a373c7d0ff0cd2281e8d4f6c6003a03d7b096 100644 (file)
           }
         }
       } else {
-        if (self.is_sticky(topbar, topbar.parent(), settings)) {
+        if (self.is_sticky(topbar, topbar.parent(), settings) && topbar.parent().offset().top==0) {
           topbar.parent().addClass('fixed');
         }