1/** @namespace doUMSPFillMenuMobileGlue */ 2jQuery(document).on('ready', function () { 3 ums_pfill_menu_init(); 4 ums_pfill_menu_init_mobile_glue() 5}); 6 7function ums_pfill_menu_init_mobile_glue() { 8 9 if (typeof doUMSPFillMenuMobileGlue === 'undefined') { 10 return; 11 } 12 13 if (doUMSPFillMenuMobileGlue === false) { 14 return; 15 } 16 17 let $pFillMobileToggleButton = jQuery('.mh-nav-trigger-case'); 18 let $pFillMobileMenuContainer = jQuery('#mh-mobile_menu_collapse'); 19 20 setInterval(function () { 21 if ($pFillMobileMenuContainer.hasClass('in') || $pFillMobileMenuContainer.hasClass('collapsing')) { 22 $pFillMobileToggleButton.addClass('pFillMenuIsOpen'); 23 } else { 24 $pFillMobileToggleButton.removeClass('pFillMenuIsOpen'); 25 } 26 }, 250) 27} 28 29function ums_pfill_menu_init() { 30 let $pFillMenuToggleBox = jQuery('li.pFillMenuToggleBox>a'); 31 let $pFillMenuToggleBoxSubMenu = jQuery('li.pFillMenuToggleBox .sub-menu'); 32 33 // create new ul wrapper 34 let $pFillMenuUL = jQuery('<ul id="pFillMenuUL"></ul>'); 35 // copy the contents of the existing sub menu ul li options 36 $pFillMenuUL.html($pFillMenuToggleBoxSubMenu.html()); 37 38 // wrap the ul in a nav element 39 let $pFillMenuNav = jQuery('<nav id="pFillMenuNav"></nav>'); 40 $pFillMenuNav.append($pFillMenuUL); 41 42 // create a new div to wrap the whole thing in 43 let $pFillMenuDiv = jQuery('<div style="display: none;" id="pFillMenuDiv"></div>'); 44 // append the nav element to it 45 $pFillMenuDiv.append($pFillMenuNav); 46 47 // add our new div before the skiptocontentanchor 48 // tag, or the top of the body if that isn't found 49 // todo: move this to an admin setting so the ID can be changed 50 if (jQuery(".headerclass .container").length) { 51 $pFillMenuDiv.insertAfter(".headerclass .container") 52 } else { 53 jQuery('body').prepend($pFillMenuDiv); 54 } 55 56 // remove the old menu so it stops displaying on hover of the original toggle menu element 57 $pFillMenuToggleBoxSubMenu.remove(); 58 59 // assign new click handler to existing menu element 60 $pFillMenuToggleBox.on('click', function () { 61 let $body = jQuery('body'); 62 let $menuDiv = jQuery('#pFillMenuDiv');
63 $menuDiv.toggle(); 64 65 let currDisp = $menuDiv.css('display'); 66 if (currDisp !== 'none') { 67 $body.addClass('pFillMenuIsOpen'); 68 $pFillMenuToggleBox.attr('aria-expanded', 'true'); 69 } else { 70 $body.removeClass('pFillMenuIsOpen'); 71 $pFillMenuToggleBox.attr('aria-expanded', 'false'); 72 } 73 return false; 74 }); 75 76 // ensure that sub-menus are visible 77 jQuery('#pFillMenuUL ul.sub-menu').show(); 78}
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.