Ticket #21562: 21562.no-jQuery.diff
| File 21562.no-jQuery.diff, 2.7 KB (added by obenland, 9 months ago) |
|---|
-
wp-content/themes/twentytwelve/style.css
532 532 color: #21759b; 533 533 } 534 534 .main-navigation .menu { 535 display: none; 535 height: 0; 536 overflow: hidden; 537 -webkit-transition: height 1s; 538 -moz-transition: height 1s; 539 -o-transition: height 1s; 540 transition: height 1s; 536 541 } 537 542 .menu-toggle { 538 543 display: inline-block; 539 544 } 545 .main-navigation .menu.toggled-on { 546 height: auto; 547 } 540 548 541 549 /* Banner */ 542 550 section[role="banner"] { … … 1343 1351 .main-navigation .menu { 1344 1352 border-bottom: 1px solid #ededed; 1345 1353 border-top: 1px solid #ededed; 1346 display: inline-block !important;1347 1354 font-size: 12px; 1348 1355 font-size: 0.857142857rem; 1356 height: auto; 1349 1357 text-align: left; 1350 1358 width: 100%; 1351 1359 } -
wp-content/themes/twentytwelve/header.php
36 36 </hgroup> 37 37 38 38 <nav class="site-navigation main-navigation" role="navigation"> 39 <h3 class="menu-toggle"><?php _e( 'Show menu', 'twentytwelve' ); ?></h3>39 <h3 id="menu-button" class="menu-toggle"><?php _e( 'Show menu', 'twentytwelve' ); ?></h3> 40 40 <div class="skip-link assistive-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a></div> 41 41 <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> 42 42 </nav> -
wp-content/themes/twentytwelve/js/navigation.js
4 4 * Handles toggling the navigation menu for small screens. 5 5 */ 6 6 7 jQuery( document ).ready( function( $ ) { 8 if ( ! $( '#masthead .menu' ).children().length ) { 9 $( '#masthead .menu-toggle' ).hide(); 10 } 11 12 $( '.menu-toggle' ).off( 'click' ).click( function() { 13 $( '#masthead .menu' ).stop().slideToggle(); 14 $( this ).toggleClass( 'toggled-on' ); 15 } ); 16 } ); 17 No newline at end of file 7 (function(){ 8 var button = document.getElementById( 'menu-button' ); 9 button.onclick = function() { 10 var menu = document.getElementById( 'menu-menu' ); 11 if ( button.className.match( new RegExp( '(\\s|^)toggled-on(\\s|$)' ) ) ) { 12 button.className = 'menu-toggle'; 13 menu.className = 'menu'; 14 } else { 15 button.className= 'menu-toggle toggled-on'; 16 menu.className = 'menu toggled-on'; 17 } 18 }; 19 })(); 20 No newline at end of file
