diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index 46b4ba3..814c01d 100644
|
|
|
|
| 250 | 250 | |
| 251 | 251 | // Adds a selected widget to the sidebar |
| 252 | 252 | submit: function( widgetTpl ) { |
| 253 | | var widgetId, widget; |
| | 253 | var widgetId, widget, widgetFormControl; |
| 254 | 254 | |
| 255 | 255 | if ( ! widgetTpl ) { |
| 256 | 256 | widgetTpl = this.selected; |
| … |
… |
|
| 268 | 268 | return; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | | this.currentSidebarControl.addWidget( widget.get( 'id_base' ) ); |
| | 271 | widgetFormControl = this.currentSidebarControl.addWidget( widget.get( 'id_base' ) ); |
| | 272 | if ( widgetFormControl ) { |
| | 273 | widgetFormControl.focus(); |
| | 274 | } |
| 272 | 275 | |
| 273 | 276 | this.close(); |
| 274 | 277 | }, |
| … |
… |
|
| 1839 | 1842 | |
| 1840 | 1843 | controlContainer.slideDown( function() { |
| 1841 | 1844 | if ( isExistingWidget ) { |
| 1842 | | widgetFormControl.expand(); |
| 1843 | 1845 | widgetFormControl.updateWidget( { |
| 1844 | 1846 | instance: widgetFormControl.setting(), |
| 1845 | 1847 | complete: function( error ) { |
| 1846 | 1848 | if ( error ) { |
| 1847 | 1849 | throw error; |
| 1848 | 1850 | } |
| 1849 | | widgetFormControl.focus(); |
| 1850 | 1851 | } |
| 1851 | 1852 | } ); |
| 1852 | | } else { |
| 1853 | | widgetFormControl.focus(); |
| 1854 | 1853 | } |
| 1855 | 1854 | } ); |
| 1856 | 1855 | |