WordPress.org

Make WordPress Core

Changeset 20017


Ignore:
Timestamp:
02/28/2012 07:17:04 PM (8 years ago)
Author:
lancewillett
Message:

Twenty Twelve: make proper use of the cached jQuery collection in navigation.js, props mattwiebe. Fixes #20131.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/js/navigation.js

    r20007 r20017  
    99
    1010    $.fn.smallMenu = function() {
    11         $( masthead ).find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' );
    12         $( masthead ).find( '.site-navigation h3' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' );
     11        masthead.find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' );
     12        masthead.find( '.site-navigation h3' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' );
    1313
    1414        $( '.menu-toggle' ).click( function() {
    15             $( masthead ).find( '.menu' ).toggle();
     15            masthead.find( '.menu' ).toggle();
    1616            $( this ).toggleClass( 'toggled-on' );
    1717        } );
     
    3333                $.fn.smallMenu();
    3434            } else {
    35                 $( masthead ).find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' );
    36                 $( masthead ).find( '.site-navigation h3' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' );
    37                 $( masthead ).find( '.menu' ).removeAttr( 'style' );
     35                masthead.find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' );
     36                masthead.find( '.site-navigation h3' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' );
     37                masthead.find( '.menu' ).removeAttr( 'style' );
    3838            }
    3939        }, 200 );
Note: See TracChangeset for help on using the changeset viewer.