Make WordPress Core

Ticket #34033: 34033-1.diff

File 34033-1.diff, 869 bytes (added by tywayne, 10 years ago)

Patch for Twenty Fifteen

  • 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                }