Make WordPress Core

Ticket #34033: 34033-4.diff

File 34033-4.diff, 2.1 KB (added by tywayne, 9 years ago)

Combined patch for all three themes

  • src/wp-content/themes/twentyfifteen/js/functions.js

     
    4949        // Enable menu toggle for small screens.
    5050        ( function() {
    5151                var menu, widgets, social;
    52                 if ( ! secondary || ! button ) {
     52                if ( ! secondary.length || ! button.length ) {
    5353                        return;
    5454                }
    5555
     
    5757                menu    = secondary.find( '.nav-menu' );
    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;
    6363                }
  • src/wp-content/themes/twentyfourteen/js/functions.js

     
    1616
    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;
    2727                }
  • src/wp-content/themes/twentythirteen/js/functions.js

     
    3434         * Enables menu toggle for small screens.
    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;
    4545                }