Customize: Fix focusing on controls for widgets and nav menu items after [38648].
Shift-click on nav menu items was not expanding the nav menu section, and shift-clicking on widgets would not always result in focus being added to an element in the control's container. See #34391. Built from https://develop.svn.wordpress.org/trunk@38668 git-svn-id: http://core.svn.wordpress.org/trunk@38611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1325,7 +1325,7 @@
|
||||
* @param {Object} args merged on top of this.defaultActiveArguments
|
||||
*/
|
||||
onChangeExpanded: function ( expanded, args ) {
|
||||
var self = this, $widget, $inside, complete, prevComplete;
|
||||
var self = this, $widget, $inside, complete, prevComplete, expandControl;
|
||||
|
||||
self.embedWidgetControl(); // Make sure the outer form is embedded so that the expanded state can be set in the UI.
|
||||
if ( expanded ) {
|
||||
@@ -1345,11 +1345,7 @@
|
||||
$widget = this.container.find( 'div.widget:first' );
|
||||
$inside = $widget.find( '.widget-inside:first' );
|
||||
|
||||
if ( expanded ) {
|
||||
|
||||
if ( self.section() && api.section( self.section() ) ) {
|
||||
self.expandControlSection();
|
||||
}
|
||||
expandControl = function() {
|
||||
|
||||
// Close all other widget controls before expanding this one
|
||||
api.control.each( function( otherControl ) {
|
||||
@@ -1379,6 +1375,16 @@
|
||||
|
||||
self.container.trigger( 'expand' );
|
||||
self.container.addClass( 'expanding' );
|
||||
};
|
||||
|
||||
if ( expanded ) {
|
||||
if ( api.section.has( self.section() ) ) {
|
||||
api.section( self.section() ).expand( {
|
||||
completeCallback: expandControl
|
||||
} );
|
||||
} else {
|
||||
expandControl();
|
||||
}
|
||||
} else {
|
||||
|
||||
complete = function() {
|
||||
|
||||
Reference in New Issue
Block a user