Skip to content
Snippets Groups Projects
Commit 7f8f5fe1 authored by khawkins's avatar khawkins
Browse files

Nav: Use a more precise calculation of <li>s in <ul>

Affects #42 and
https://github.com/ebiwd/EBI-Framework/commit/f098ddc0a1e6478208eac7e7f1
f49494f9dd1d96#commitcomment-19644988
parent 575fb4bf
No related branches found
No related tags found
No related merge requests found
......@@ -252,10 +252,16 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
var localMenuWidthAvail = $('#local-masthead .masthead > nav').innerWidth() - localMenuLeftPadding;
function localNavSpilloverMenu(changeDirection) {
var localMenuWidthUsed = $(localMenuClass).outerWidth(); // how much space is occupied by the ul
var localMenuWidthUsed = 0; // Track how much space is occupied by the ul
var localMenuRightSideWidth = $('#local-masthead .masthead > nav ul.float-right.menu').outerWidth(); // width of any right-side nav, which would change on browser resize
localMenuRightSideWidth = localMenuRightSideWidth + 1; // padding, eleminate NaN if it doesn't exsist
// Calculate how much space we've used
// We calculate each li and not the parent ul as some teams may make the ul 100% wide
$(localMenuClass+' > li').each( function() {
localMenuWidthUsed = localMenuWidthUsed + $(this).outerWidth();
});
// Account for any float-right menu
localMenuWidthUsed = localMenuWidthUsed + localMenuRightSideWidth;
......
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