From 120d5550658b2af4cb5fc09c1745348ebdda9e2d Mon Sep 17 00:00:00 2001 From: Sylvio Date: Sat, 19 Dec 2015 12:02:51 +0100 Subject: [PATCH] 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. --- js/foundation/foundation.topbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); } -- 2.47.2