Changeset 39622
- Timestamp:
- 12/20/2016 10:04:22 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r39557 r39622 5366 5366 // Focus on the control that is associated with the given setting. 5367 5367 api.previewer.bind( 'focus-control-for-setting', function( settingId ) { 5368 var matchedControl ;5368 var matchedControls = []; 5369 5369 api.control.each( function( control ) { 5370 5370 var settingIds = _.pluck( control.settings, 'id' ); 5371 5371 if ( -1 !== _.indexOf( settingIds, settingId ) ) { 5372 matchedControl = control;5372 matchedControls.push( control ); 5373 5373 } 5374 5374 } ); 5375 5375 5376 if ( matchedControl ) { 5377 matchedControl.focus(); 5376 // Focus on the matched control with the lowest priority (appearing higher). 5377 if ( matchedControls.length ) { 5378 matchedControls.sort( function( a, b ) { 5379 return a.priority() - b.priority(); 5380 } ); 5381 matchedControls[0].focus(); 5378 5382 } 5379 5383 } ); -
trunk/src/wp-includes/js/customize-selective-refresh.js
r39581 r39622 313 313 */ 314 314 showControl: function() { 315 var partial = this, settingId = partial.params.primarySetting , menuSlug;315 var partial = this, settingId = partial.params.primarySetting; 316 316 if ( ! settingId ) { 317 317 settingId = _.first( partial.settings() ); 318 318 } 319 319 if ( partial.getType() === 'nav_menu' ) { 320 menuSlug = partial.params.navMenuArgs.theme_location; 321 if ( menuSlug ) { 322 settingId = 'nav_menu_locations[' + menuSlug + ']'; 320 if ( partial.params.navMenuArgs.theme_location ) { 321 settingId = 'nav_menu_locations[' + partial.params.navMenuArgs.theme_location + ']'; 322 } else if ( partial.params.navMenuArgs.menu ) { 323 settingId = 'nav_menu[' + String( partial.params.navMenuArgs.menu ) + ']'; 323 324 } 324 325 }
Note: See TracChangeset
for help on using the changeset viewer.