Changeset 8154
- Timestamp:
- 01/28/2019 08:15:10 AM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/style/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/style/js/navigation.js
r8147 r8154 11 11 } 12 12 13 button = container.getElementsByTagName( 'button' )[1];13 button = document.getElementById( 'mobile-menu-button' ); 14 14 if ( 'undefined' === typeof button ) { 15 15 return; 16 16 } 17 17 18 menu = container.getElementsByTagName( 'ul' )[0];18 menu = document.getElementById( 'wporg-header-menu' ); 19 19 20 20 // Hide menu toggle button if menu is empty and return early. -
sites/trunk/wordpress.org/public_html/style/js/navigation.min.js
r8147 r8154 1 !function(e){var n,a,t,s,l,c;if((n=document.getElementById("wporg-header"))&&void 0!==(a=n.getElementsByTagName("button")[1]))if(void 0!==(t=n.getElementsByTagName("ul")[0])){for(-1===t.className.indexOf("nav-menu")&&(t.className+=" nav-menu"),a.onclick=function(){-1!==t.className.indexOf("toggled")?(t.className=t.className.replace(" toggled",""),a.setAttribute("aria-expanded","false")):(t.className+=" toggled",a.setAttribute("aria-expanded","true"))},l=0,c=(s=t.getElementsByTagName("a")).length;l<c;l++)s[l].addEventListener("focus",i,!0),s[l].addEventListener("blur",i,!0);!function(e){var a,t,s=n.querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a");if("ontouchstart"in window)for(a=function(e){var a,t=this.parentNode;if(t.classList.contains("focus"))t.classList.remove("focus");else{for(e.preventDefault(),a=0;a<t.parentNode.children.length;++a)t!==t.parentNode.children[a]&&t.parentNode.children[a].classList.remove("focus");t.classList.add("focus")}},t=0;t<s.length;++t)s[t].addEventListener("touchstart",a,!1)}()}else a.style.display="none";function i(){for(var e=this;-1===e.className.indexOf("nav-menu");)"li"===e.tagName.toLowerCase()&&(-1!==e.className.indexOf("focus")?e.className=e.className.replace(" focus",""):e.className+=" focus"),e=e.parentElement}}();1 !function(e){var s,a,t,n,l,o;if((s=document.getElementById("wporg-header"))&&void 0!==(a=document.getElementById("mobile-menu-button")))if(void 0!==(t=document.getElementById("wporg-header-menu"))){for(-1===t.className.indexOf("nav-menu")&&(t.className+=" nav-menu"),a.onclick=function(){-1!==t.className.indexOf("toggled")?(t.className=t.className.replace(" toggled",""),a.setAttribute("aria-expanded","false")):(t.className+=" toggled",a.setAttribute("aria-expanded","true"))},l=0,o=(n=t.getElementsByTagName("a")).length;l<o;l++)n[l].addEventListener("focus",c,!0),n[l].addEventListener("blur",c,!0);!function(e){var a,t,n=s.querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a");if("ontouchstart"in window)for(a=function(e){var a,t=this.parentNode;if(t.classList.contains("focus"))t.classList.remove("focus");else{for(e.preventDefault(),a=0;a<t.parentNode.children.length;++a)t!==t.parentNode.children[a]&&t.parentNode.children[a].classList.remove("focus");t.classList.add("focus")}},t=0;t<n.length;++t)n[t].addEventListener("touchstart",a,!1)}()}else a.style.display="none";function c(){for(var e=this;-1===e.className.indexOf("nav-menu");)"li"===e.tagName.toLowerCase()&&(-1!==e.className.indexOf("focus")?e.className=e.className.replace(" focus",""):e.className+=" focus"),e=e.parentElement}}();
Note: See TracChangeset
for help on using the changeset viewer.