WordPress.org

Make WordPress Core

Changeset 39423


Ignore:
Timestamp:
12/02/16 06:33:25 (4 months ago)
Author:
helen
Message:

Twenty Seventeen: Fix broken menu toggle in Customizer after menu items are added

This simplifies the line $( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' ); to $( siteNavContain ).toggleClass( 'toggled-on' );, since this is the clicked button, so the extra context isn't needed.

Props afercia, laurelfulford.

Fixes #38992 for the 4.7 branch.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-content/themes/twentyseventeen/assets/js/navigation.js

    r39232 r39423  
    77 
    88(function( $ ) { 
    9     var masthead, menuToggle, siteNavigation; 
     9    var masthead, menuToggle, siteNavContain, siteNavigation; 
    1010 
    1111    function initMainNavigation( container ) { 
     
    4040    masthead       = $( '#masthead' ); 
    4141    menuToggle     = masthead.find( '.menu-toggle' ); 
     42    siteNavContain = masthead.find( '.main-navigation' ); 
    4243    siteNavigation = masthead.find( '.main-navigation > div > ul' ); 
    4344 
     
    5455 
    5556        menuToggle.on( 'click.twentyseventeen', function() { 
    56             $( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' ); 
     57            $( siteNavContain ).toggleClass( 'toggled-on' ); 
    5758 
    5859            $( this ) 
Note: See TracChangeset for help on using the changeset viewer.