Commit e84c9053 authored by Deimos's avatar Deimos

Use "outer" sizes for checking dropdown overflow

The "outer" width/height functions also include padding and border. Not
including these didn't make a noticeable difference for the left/right
flipping (the omissions almost canceled each other out), but the
discrepancy is much more noticeable on the top/bottom flipping.
parent ca38cd67
......@@ -32,12 +32,12 @@ $.onmount(".dropdown-toggle", function() {
$this.offset().left + $this.width() - $menu.width() > 0
$this.offset().left + $this.outerWidth() - $menu.outerWidth() > 0
// If the menu extends past the bottom of the viewport, or the site footer
// overlaps the menu, push the menu above the button instead.
var menuBottom = $this.offset().top + $this.height() + $menu.height();
var menuBottom = $this.offset().top + $this.outerHeight() + $menu.outerHeight();
var viewportHeight = $(window).height();
var scrollTop = $(document).scrollTop();
var footerTop = $("#site-footer").offset().top;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment