Twenty Twelve: make proper use of the cached jQuery collection in navigation.js, props mattwiebe. Fixes #20131.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d131a8951a
commit
e3813d7b68
|
@ -8,11 +8,11 @@ jQuery( document ).ready( function( $ ) {
|
|||
timeout = false;
|
||||
|
||||
$.fn.smallMenu = function() {
|
||||
$( masthead ).find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' );
|
||||
$( masthead ).find( '.site-navigation h3' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' );
|
||||
masthead.find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' );
|
||||
masthead.find( '.site-navigation h3' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' );
|
||||
|
||||
$( '.menu-toggle' ).click( function() {
|
||||
$( masthead ).find( '.menu' ).toggle();
|
||||
masthead.find( '.menu' ).toggle();
|
||||
$( this ).toggleClass( 'toggled-on' );
|
||||
} );
|
||||
};
|
||||
|
@ -32,9 +32,9 @@ jQuery( document ).ready( function( $ ) {
|
|||
if ( browserWidth < 600 ) {
|
||||
$.fn.smallMenu();
|
||||
} else {
|
||||
$( masthead ).find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' );
|
||||
$( masthead ).find( '.site-navigation h3' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' );
|
||||
$( masthead ).find( '.menu' ).removeAttr( 'style' );
|
||||
masthead.find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' );
|
||||
masthead.find( '.site-navigation h3' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' );
|
||||
masthead.find( '.menu' ).removeAttr( 'style' );
|
||||
}
|
||||
}, 200 );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue