Ticket #24839: 24839.twenty-twelve.3.diff
File 24839.twenty-twelve.3.diff, 3.9 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 ); -
wp-content/themes/twentytwelve/style.css
590 590 .main-navigation a { 591 591 color: #5e5e5e; 592 592 } 593 .main-navigation a:hover { 593 .main-navigation a:hover, 594 .main-navigation a:focus { 594 595 color: #21759b; 595 596 } 596 597 .main-navigation ul.nav-menu, … … 1509 1510 text-transform: uppercase; 1510 1511 white-space: nowrap; 1511 1512 } 1512 .main-navigation li a:hover { 1513 .main-navigation li a:hover, 1514 .main-navigation li a:focus { 1513 1515 color: #000; 1514 1516 } 1515 1517 .main-navigation li { … … 1518 1520 position: relative; 1519 1521 } 1520 1522 .main-navigation li ul { 1521 display: none;1522 1523 margin: 0; 1523 1524 padding: 0; 1524 1525 position: absolute; 1525 1526 top: 100%; 1526 1527 z-index: 1; 1528 height: 1px; 1529 width: 1px; 1530 overflow: hidden; 1531 clip: rect(1px, 1px, 1px, 1px) 1527 1532 } 1528 1533 .main-navigation li ul ul { 1529 1534 top: 0; 1530 1535 left: 100%; 1531 1536 } 1532 .main-navigation ul li:hover > ul { 1537 .main-navigation ul li:hover > ul, 1538 .main-navigation ul li:focus > ul, 1539 .main-navigation .focus > ul { 1533 1540 border-left: 0; 1534 display: block; 1541 clip: inherit; 1542 overflow: inherit; 1543 height: inherit; 1544 width: inherit; 1535 1545 } 1536 1546 .main-navigation li ul li a { 1537 1547 background: #efefef; … … 1546 1556 width: 12.85714286rem; 1547 1557 white-space: normal; 1548 1558 } 1549 .main-navigation li ul li a:hover { 1559 .main-navigation li ul li a:hover, 1560 .main-navigation li ul li a:focus { 1550 1561 background: #e3e3e3; 1551 1562 color: #444; 1552 1563 }