1// MAIN MENU 2const $mainMenu = $("#mainMenu"); 3const $autoNav = $("#autoNav"); 4const $autoNavMore = $("#autoNavMore"); 5const $autoNavMoreList = $("#autoNavMoreList"); 6autoNavMore = () => { 7 let childNumber = 2; 8 9 if ($(window).width() >= 320) { 10 // GET MENU AND NAV WIDTH 11 const $menuWidth = $mainMenu.width(); 12 const $autoNavWidth = $autoNav.width(); 13 if ($autoNavWidth > $menuWidth) { 14 // CODE FIRES WHEN WINDOW SIZE GOES DOWN 15 $autoNav 16 .children(`li:nth-last-child(${childNumber})`) 17 .prependTo($autoNavMoreList); 18 autoNavMore(); 19 } else { 20 // CODE FIRES WHEN WINDOW SIZE GOES UP 21 const $autoNavMoreFirst = $autoNavMoreList 22 .children("li:first-child") 23 .width(); 24 // CHECK IF ITEM HAS ENOUGH SPACE TO PLACE IN MENU 25 if ($autoNavWidth + $autoNavMoreFirst < $menuWidth) { 26 $autoNavMoreList.children("li:first-child").insertBefore($autoNavMore); 27 } 28 } 29 if ($autoNavMoreList.children().length > 0) { 30 $autoNavMore.show(); 31 childNumber = 2; 32 } else { 33 $autoNavMore.hide(); 34 childNumber = 1; 35 } 36 } 37}; 38// INIT 39autoNavMore(); 40$(window).resize(autoNavMore); 41// MAIN MENU END
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.