From: Sylvio Date: Sat, 19 Dec 2015 11:02:51 +0000 (+0100) Subject: Fix bug when having scrolltop=false, sticky top bar X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7631%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix bug when having scrolltop=false, sticky top bar 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. --- diff --git a/js/foundation/foundation.topbar.js b/js/foundation/foundation.topbar.js index 51eb03de5..507a373c7 100644 --- a/js/foundation/foundation.topbar.js +++ b/js/foundation/foundation.topbar.js @@ -134,7 +134,7 @@ } } } 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'); }