Twenty Thirteen, Twenty Fourteen and Twenty Fifteen: Fixes insufficient check for existence of DOM elements in jQuery object

Fixes #34033
Props: tywayne 

Built from https://develop.svn.wordpress.org/trunk@36999


git-svn-id: http://core.svn.wordpress.org/trunk@36966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2016-03-15 21:33:28 +00:00
parent 942f9d6357
commit 12c6679165
4 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@
// Enable menu toggle for small screens. // Enable menu toggle for small screens.
( function() { ( function() {
var menu, widgets, social; var menu, widgets, social;
if ( ! secondary || ! button ) { if ( ! secondary.length || ! button.length ) {
return; return;
} }
@ -57,7 +57,7 @@
menu = secondary.find( '.nav-menu' ); menu = secondary.find( '.nav-menu' );
widgets = secondary.find( '#widget-area' ); widgets = secondary.find( '#widget-area' );
social = secondary.find( '#social-navigation' ); social = secondary.find( '#social-navigation' );
if ( ! widgets.length && ! social.length && ( ! menu || ! menu.children().length ) ) { if ( ! widgets.length && ! social.length && ( ! menu.length || ! menu.children().length ) ) {
button.hide(); button.hide();
return; return;
} }

View File

@ -16,12 +16,12 @@
// Enable menu toggle for small screens. // Enable menu toggle for small screens.
( function() { ( function() {
if ( ! nav || ! button ) { if ( ! nav.length || ! button.length ) {
return; return;
} }
// Hide button if menu is missing or empty. // Hide button if menu is missing or empty.
if ( ! menu || ! menu.children().length ) { if ( ! menu.length || ! menu.children().length ) {
button.hide(); button.hide();
return; return;
} }

View File

@ -34,12 +34,12 @@
* Enables menu toggle for small screens. * Enables menu toggle for small screens.
*/ */
( function() { ( function() {
if ( ! nav || ! button ) { if ( ! nav.length || ! button.length ) {
return; return;
} }
// Hide button if menu is missing or empty. // Hide button if menu is missing or empty.
if ( ! menu || ! menu.children().length ) { if ( ! menu.length || ! menu.children().length ) {
button.hide(); button.hide();
return; return;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-beta3-36998'; $wp_version = '4.5-beta3-36999';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.