From 6bc7b7c066b6ed5f3533763301f68266296f06a5 Mon Sep 17 00:00:00 2001 From: Tammie Date: Tue, 15 Mar 2016 21:32:15 +0000 Subject: [PATCH] Twenty Thirteen, Twenty Fourteen and Twenty Fifteen: Fixes insufficient check for existence of DOM elements in jQuery object Fixes #34033 Props: tywayne git-svn-id: https://develop.svn.wordpress.org/trunk@36999 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyfifteen/js/functions.js | 4 ++-- src/wp-content/themes/twentyfourteen/js/functions.js | 4 ++-- src/wp-content/themes/twentythirteen/js/functions.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-content/themes/twentyfifteen/js/functions.js b/src/wp-content/themes/twentyfifteen/js/functions.js index 9adad87e39..2da5cbc340 100644 --- a/src/wp-content/themes/twentyfifteen/js/functions.js +++ b/src/wp-content/themes/twentyfifteen/js/functions.js @@ -49,7 +49,7 @@ // Enable menu toggle for small screens. ( function() { var menu, widgets, social; - if ( ! secondary || ! button ) { + if ( ! secondary.length || ! button.length ) { return; } @@ -57,7 +57,7 @@ menu = secondary.find( '.nav-menu' ); widgets = secondary.find( '#widget-area' ); 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(); return; } diff --git a/src/wp-content/themes/twentyfourteen/js/functions.js b/src/wp-content/themes/twentyfourteen/js/functions.js index 603e1379a0..1355204308 100644 --- a/src/wp-content/themes/twentyfourteen/js/functions.js +++ b/src/wp-content/themes/twentyfourteen/js/functions.js @@ -16,12 +16,12 @@ // Enable menu toggle for small screens. ( function() { - if ( ! nav || ! button ) { + if ( ! nav.length || ! button.length ) { return; } // Hide button if menu is missing or empty. - if ( ! menu || ! menu.children().length ) { + if ( ! menu.length || ! menu.children().length ) { button.hide(); return; } diff --git a/src/wp-content/themes/twentythirteen/js/functions.js b/src/wp-content/themes/twentythirteen/js/functions.js index fa8160d53a..d1528557bf 100644 --- a/src/wp-content/themes/twentythirteen/js/functions.js +++ b/src/wp-content/themes/twentythirteen/js/functions.js @@ -34,12 +34,12 @@ * Enables menu toggle for small screens. */ ( function() { - if ( ! nav || ! button ) { + if ( ! nav.length || ! button.length ) { return; } // Hide button if menu is missing or empty. - if ( ! menu || ! menu.children().length ) { + if ( ! menu.length || ! menu.children().length ) { button.hide(); return; }