Customizer: Don't focus new widgets if they are added programmatically.
props westonruter. fixes #31295. Built from https://develop.svn.wordpress.org/trunk@31428 git-svn-id: http://core.svn.wordpress.org/trunk@31409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -250,7 +250,7 @@
|
||||
|
||||
// Adds a selected widget to the sidebar
|
||||
submit: function( widgetTpl ) {
|
||||
var widgetId, widget;
|
||||
var widgetId, widget, widgetFormControl;
|
||||
|
||||
if ( ! widgetTpl ) {
|
||||
widgetTpl = this.selected;
|
||||
@@ -268,7 +268,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
this.currentSidebarControl.addWidget( widget.get( 'id_base' ) );
|
||||
widgetFormControl = this.currentSidebarControl.addWidget( widget.get( 'id_base' ) );
|
||||
if ( widgetFormControl ) {
|
||||
widgetFormControl.focus();
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
@@ -1844,18 +1847,14 @@
|
||||
|
||||
controlContainer.slideDown( function() {
|
||||
if ( isExistingWidget ) {
|
||||
widgetFormControl.expand();
|
||||
widgetFormControl.updateWidget( {
|
||||
instance: widgetFormControl.setting(),
|
||||
complete: function( error ) {
|
||||
if ( error ) {
|
||||
throw error;
|
||||
}
|
||||
widgetFormControl.focus();
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
widgetFormControl.focus();
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
2
wp-admin/js/customize-widgets.min.js
vendored
2
wp-admin/js/customize-widgets.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user