Make WordPress Core

Ticket #38663: 38663.diff

File 38663.diff, 1.7 KB (added by celloexpressions, 7 years ago)
  • src/wp-admin/js/customize-controls.js

     
    11731173
    11741174                        // Expand section/panel. Only collapse when opening another section.
    11751175                        section.filterContainer.on( 'click', '.customize-themes-section-title', function() {
    1176                                 // Open the section.
    1177                                 if ( ! section.expanded() ) {
    1178                                         section.expand();
    1179                                 }
    11801176
    11811177                                // Toggle filters.
    11821178                                if ( section.filterContainer.find( '.filter-details' ).length ) {
     
    11871183                                                });
    11881184                                        section.filterContainer.find( '.filter-details' ).slideToggle( 180 );
    11891185                                }
     1186
     1187                                // Open the section.
     1188                                if ( ! section.expanded() ) {
     1189
     1190                                        // Don't expand if there's nothing to show.
     1191                                        if ( -1 !== $.inArray( section.params.action, [ 'search', 'favorites', 'feature_filter' ] ) && '' === section.term ) {
     1192                                                return;
     1193                                        } else {
     1194                                                section.expand();
     1195                                        }
     1196                                }
    11901197                        });
    11911198
    11921199                        // Preview installed themes.
     
    12481255                                        }
    12491256                                });
    12501257                        } else if ( 'favorites' === section.params.action ) {
     1258                                section.checkTerm( section ); // Expand the section if there's already a term.
    12511259                                section.container.on( 'click', '.favorites-form-submit', function() {
    12521260                                        section.checkTerm( section );
    12531261                                });
     
    12581266                                        section.checkTerm( section );
    12591267                                });
    12601268                        } else if ( 'feature_filter' === section.params.action ) {
     1269                                section.checkTerm( section ); // Expand the section if there's already a term.
    12611270                                section.container.on( 'click', '.filter-group input', function() {
    12621271                                        section.filtersChecked();
    12631272                                        section.checkTerm( section );