From: Lou Huang Date: Fri, 6 Dec 2013 06:07:33 +0000 (-0800) Subject: Fix topbar behavior when scrolltop setting is false X-Git-Tag: 5.0.3~71^2~24^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3822%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix topbar behavior when scrolltop setting is false When a topbar's ```scrolltop``` setting is set to false, the expected behavior is that the page content below the dropdown should not move at all. The actual behavior is that when the page content has scrolled past the top, and the dropdown is displayed, then the page content will move upwards by an amount equal to the topbar's height. This is because the the class ```f-topbar-fixed``` is not being applied to the body when the dropdown is displayed. This is fixed in the commit here. The ```f-topbar-fixed``` class does not need to be manually removed when the dropdown is closed, since ```self.update_sticky_positioning()``` will take care it. --- diff --git a/js/foundation/foundation.topbar.js b/js/foundation/foundation.topbar.js index 170892fc9..8db9ea1da 100644 --- a/js/foundation/foundation.topbar.js +++ b/js/foundation/foundation.topbar.js @@ -121,6 +121,7 @@ } else { topbar.addClass('fixed'); topbar.parent().addClass('expanded'); + $('body').addClass('f-topbar-fixed'); } } }