Changeset 38668
- Timestamp:
- 09/28/2016 04:19:37 AM (7 years ago)
- Location:
- trunk/src/wp-admin/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-nav-menus.js
r38648 r38668 1530 1530 expandControlSection: function() { 1531 1531 var $section = this.container.closest( '.accordion-section' ); 1532 1533 1532 if ( ! $section.hasClass( 'open' ) ) { 1534 1533 $section.find( '.accordion-section-title:first' ).trigger( 'click' ); … … 1684 1683 focus: function( params ) { 1685 1684 params = params || {}; 1686 var control = this, originalCompleteCallback = params.completeCallback; 1687 1688 control.expandControlSection(); 1689 1690 params.completeCallback = function() { 1691 var focusable; 1692 1693 // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 1694 focusable = control.container.find( '.menu-item-settings' ).find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ); 1695 focusable.first().focus(); 1696 1697 if ( originalCompleteCallback ) { 1698 originalCompleteCallback(); 1699 } 1685 var control = this, originalCompleteCallback = params.completeCallback, focusControl; 1686 1687 focusControl = function() { 1688 control.expandControlSection(); 1689 1690 params.completeCallback = function() { 1691 var focusable; 1692 1693 // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 1694 focusable = control.container.find( '.menu-item-settings' ).find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ); 1695 focusable.first().focus(); 1696 1697 if ( originalCompleteCallback ) { 1698 originalCompleteCallback(); 1699 } 1700 }; 1701 1702 control.expandForm( params ); 1700 1703 }; 1701 1704 1702 control.expandForm( params ); 1705 if ( api.section.has( control.section() ) ) { 1706 api.section( control.section() ).expand( { 1707 completeCallback: focusControl 1708 } ); 1709 } else { 1710 focusControl(); 1711 } 1703 1712 }, 1704 1713 … … 2956 2965 api.Menus.focusMenuItemControl = function( menuItemId ) { 2957 2966 var control = api.Menus.getMenuItemControl( menuItemId ); 2958 2959 2967 if ( control ) { 2960 2968 control.focus(); -
trunk/src/wp-admin/js/customize-widgets.js
r37994 r38668 1326 1326 */ 1327 1327 onChangeExpanded: function ( expanded, args ) { 1328 var self = this, $widget, $inside, complete, prevComplete ;1328 var self = this, $widget, $inside, complete, prevComplete, expandControl; 1329 1329 1330 1330 self.embedWidgetControl(); // Make sure the outer form is embedded so that the expanded state can be set in the UI. … … 1346 1346 $inside = $widget.find( '.widget-inside:first' ); 1347 1347 1348 if ( expanded ) { 1349 1350 if ( self.section() && api.section( self.section() ) ) { 1351 self.expandControlSection(); 1352 } 1348 expandControl = function() { 1353 1349 1354 1350 // Close all other widget controls before expanding this one … … 1380 1376 self.container.trigger( 'expand' ); 1381 1377 self.container.addClass( 'expanding' ); 1378 }; 1379 1380 if ( expanded ) { 1381 if ( api.section.has( self.section() ) ) { 1382 api.section( self.section() ).expand( { 1383 completeCallback: expandControl 1384 } ); 1385 } else { 1386 expandControl(); 1387 } 1382 1388 } else { 1383 1389
Note: See TracChangeset
for help on using the changeset viewer.