From: Kristofer Krause Date: Wed, 2 Sep 2015 17:24:10 +0000 (-0400) Subject: windowWidth variable added; indentation X-Git-Tag: v5.5.3~40^2~1^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6869%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git windowWidth variable added; indentation --- diff --git a/js/foundation/foundation.dropdown.js b/js/foundation/foundation.dropdown.js index 87b119bb9..771a100e6 100644 --- a/js/foundation/foundation.dropdown.js +++ b/js/foundation/foundation.dropdown.js @@ -275,23 +275,25 @@ //lets see if the panel will be off the screen //get the actual width of the page and store it var actualBodyWidth; + var windowWidth = window.innerWidth; + if (document.getElementsByClassName('row')[0]) { actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth; } else { - actualBodyWidth = window.innerWidth; + actualBodyWidth = windowWidth; } - var actualMarginWidth = (window.innerWidth - actualBodyWidth) / 2; + var actualMarginWidth = (windowWidth - actualBodyWidth) / 2; var actualBoundary = actualBodyWidth; if (!this.hasClass('mega') && !s.ignore_repositioning) { - var outerWidth = this.outerWidth(); - var o_left = t.offset().left; + var outerWidth = this.outerWidth(); + var o_left = t.offset().left; //miss top if (t.offset().top <= this.outerHeight()) { p.missTop = true; - actualBoundary = window.innerWidth - actualMarginWidth; + actualBoundary = windowWidth - actualMarginWidth; p.leftRightFlag = true; }