From c0a9b1e57f8512dc693aadc12c1c4b33f247e07b Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Fri, 2 Dec 2016 06:25:42 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@39419 git-svn-id: http://core.svn.wordpress.org/trunk@39359 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyseventeen/assets/js/navigation.js | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentyseventeen/assets/js/navigation.js b/wp-content/themes/twentyseventeen/assets/js/navigation.js index c1af2af3fa..da50e0fae1 100644 --- a/wp-content/themes/twentyseventeen/assets/js/navigation.js +++ b/wp-content/themes/twentyseventeen/assets/js/navigation.js @@ -6,7 +6,7 @@ */ (function( $ ) { - var masthead, menuToggle, siteNavigation; + var masthead, menuToggle, siteNavContain, siteNavigation; function initMainNavigation( container ) { @@ -39,6 +39,7 @@ masthead = $( '#masthead' ); menuToggle = masthead.find( '.menu-toggle' ); + siteNavContain = masthead.find( '.main-navigation' ); siteNavigation = masthead.find( '.main-navigation > div > ul' ); // Enable menuToggle. @@ -53,7 +54,7 @@ menuToggle.add( siteNavigation ).attr( 'aria-expanded', 'false' ); menuToggle.on( 'click.twentyseventeen', function() { - $( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' ); + $( siteNavContain ).toggleClass( 'toggled-on' ); $( this ) .add( siteNavigation ) diff --git a/wp-includes/version.php b/wp-includes/version.php index f260ff85ca..634b884c43 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39418'; +$wp_version = '4.8-alpha-39419'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.