Ticket #24839: 24839.twenty-twelve.2.diff
File 24839.twenty-twelve.2.diff, 3.2 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentytwelve/css/ie.css
110 110 position: absolute; 111 111 top: 100%; 112 112 z-index: 1; 113 clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 113 114 } 114 115 .ie7 .main-navigation li ul { 115 116 left: 0; -
wp-content/themes/twentytwelve/functions.php
140 140 wp_enqueue_script( 'comment-reply' ); 141 141 142 142 // Adds JavaScript for handling the navigation menu hide-and-show behavior. 143 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( ), '1.0', true );143 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140318', true ); 144 144 145 145 $font_url = twentytwelve_get_font_url(); 146 146 if ( ! empty( $font_url ) ) -
wp-content/themes/twentytwelve/js/navigation.js
5 5 */ 6 6 ( function() { 7 7 var nav = document.getElementById( 'site-navigation' ), button, menu; 8 if ( ! nav ) 8 if ( ! nav ) { 9 9 return; 10 } 11 10 12 button = nav.getElementsByTagName( 'h3' )[0]; 11 13 menu = nav.getElementsByTagName( 'ul' )[0]; 12 if ( ! button ) 14 if ( ! button ) { 13 15 return; 16 } 14 17 15 18 // Hide button if menu is missing or empty. 16 19 if ( ! menu || ! menu.childNodes.length ) { … … 19 22 } 20 23 21 24 button.onclick = function() { 22 if ( -1 == menu.className.indexOf( 'nav-menu' ) ) 25 if ( -1 == menu.className.indexOf( 'nav-menu' ) ) { 23 26 menu.className = 'nav-menu'; 27 } 24 28 25 29 if ( -1 != button.className.indexOf( 'toggled-on' ) ) { 26 30 button.className = button.className.replace( ' toggled-on', '' ); … … 30 34 menu.className += ' toggled-on'; 31 35 } 32 36 }; 33 } )(); 34 No newline at end of file 37 } )(); 38 39 ( function( $ ) { 40 $( '.main-navigation' ).find( 'a' ).on( 'focus blur', function() { 41 $( this ).parents( '.menu-item' ).toggleClass( 'focus' ); 42 } ); 43 } )( jQuery ); 44 No newline at end of file -
wp-content/themes/twentytwelve/style.css
1518 1518 position: relative; 1519 1519 } 1520 1520 .main-navigation li ul { 1521 display: none;1522 1521 margin: 0; 1523 1522 padding: 0; 1524 1523 position: absolute; 1525 1524 top: 100%; 1526 1525 z-index: 1; 1526 height: 1px; 1527 width: 1px; 1528 overflow: hidden; 1529 clip: rect(1px, 1px, 1px, 1px) 1527 1530 } 1528 1531 .main-navigation li ul ul { 1529 1532 top: 0; 1530 1533 left: 100%; 1531 1534 } 1532 .main-navigation ul li:hover > ul { 1535 .main-navigation ul li:hover > ul, 1536 .main-navigation .focus > ul { 1533 1537 border-left: 0; 1534 display: block; 1538 clip: inherit; 1539 overflow: inherit; 1540 height: inherit; 1541 width: inherit; 1535 1542 } 1536 1543 .main-navigation li ul li a { 1537 1544 background: #efefef;