Ticket #38365: 38365.diff
| File 38365.diff, 1.3 KB (added by , 9 years ago) |
|---|
-
src/wp-admin/js/customize-controls.js
1079 1079 loading: false, 1080 1080 fullyLoaded: false, 1081 1081 term: '', 1082 nextTerm: '', 1082 1083 filterContainer: $(), 1083 1084 1084 1085 /** … … 1411 1412 request.done(function( data ) { 1412 1413 var themes = data.themes, 1413 1414 themeControl, newThemeControls; 1415 1416 // Stop and try again if the term changed. 1417 if ( section.nextTerm ) { 1418 section.term = section.nextTerm; 1419 section.nextTerm = ''; 1420 section.loading = false; 1421 section.loadControls(); 1422 return; 1423 } 1424 1414 1425 if ( 0 !== themes.length ) { 1415 1426 newThemeControls = []; 1416 1427 // Add controls for each theme. … … 1545 1556 if ( '' !== newTerm ) { // Empty term should not show any results. 1546 1557 // Run a new query, with loadControls handling paging, etc. 1547 1558 section.term = newTerm; 1548 section.loadControls(); 1559 if ( ! section.loading ) { 1560 section.loadControls(); 1561 } else { 1562 section.nextTerm = newTerm; // This will reload with the newest term once the current batch is loaded. 1563 } 1549 1564 if ( ! section.expanded() ) { 1550 1565 section.expand(); // Expand the section if it isn't expanded. 1551 1566 }