]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix topbar behavior when scrolltop setting is false 3822/head
authorLou Huang <lou@codeforamerica.org>
Fri, 6 Dec 2013 06:07:33 +0000 (22:07 -0800)
committerLou Huang <lou@codeforamerica.org>
Fri, 6 Dec 2013 06:07:33 +0000 (22:07 -0800)
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.

js/foundation/foundation.topbar.js

index 170892fc9855a3a28607b333e8c74f9fc76e0cd1..8db9ea1dafb2254a5c535354b4d6491cd309b334 100644 (file)
           } else {
             topbar.addClass('fixed');
             topbar.parent().addClass('expanded');
+            $('body').addClass('f-topbar-fixed');
           }
         }
       }