Make WordPress Core

Changeset 36999


Ignore:
Timestamp:
03/15/2016 09:32:15 PM (10 years ago)
Author:
karmatosed
Message:

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

Location:
trunk/src/wp-content/themes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/js/functions.js

    r33491 r36999  
    5050        ( function() {
    5151                var menu, widgets, social;
    52                 if ( ! secondary || ! button ) {
     52                if ( ! secondary.length || ! button.length ) {
    5353                        return;
    5454                }
     
    5858                widgets = secondary.find( '#widget-area' );
    5959                social  = secondary.find( '#social-navigation' );
    60                 if ( ! widgets.length && ! social.length && ( ! menu || ! menu.children().length ) ) {
     60                if ( ! widgets.length && ! social.length && ( ! menu.length || ! menu.children().length ) ) {
    6161                        button.hide();
    6262                        return;
  • trunk/src/wp-content/themes/twentyfourteen/js/functions.js

    r31814 r36999  
    1717        // Enable menu toggle for small screens.
    1818        ( function() {
    19                 if ( ! nav || ! button ) {
     19                if ( ! nav.length || ! button.length ) {
    2020                        return;
    2121                }
    2222
    2323                // Hide button if menu is missing or empty.
    24                 if ( ! menu || ! menu.children().length ) {
     24                if ( ! menu.length || ! menu.children().length ) {
    2525                        button.hide();
    2626                        return;
  • trunk/src/wp-content/themes/twentythirteen/js/functions.js

    r31932 r36999  
    3535         */
    3636        ( function() {
    37                 if ( ! nav || ! button ) {
     37                if ( ! nav.length || ! button.length ) {
    3838                        return;
    3939                }
    4040
    4141                // Hide button if menu is missing or empty.
    42                 if ( ! menu || ! menu.children().length ) {
     42                if ( ! menu.length || ! menu.children().length ) {
    4343                        button.hide();
    4444                        return;
Note: See TracChangeset for help on using the changeset viewer.