Changeset 51946
- Timestamp:
- 10/28/2021 05:27:04 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/common.js
r50547 r51946 1696 1696 } ); 1697 1697 1698 // Close sidebar when focus moves outside of toggle and sidebar. 1699 $( '#wp-admin-bar-menu-toggle, #adminmenumain' ).on( 'focusout', function() { 1700 var focusIsInToggle, focusIsInSidebar; 1701 1702 if ( ! $wpwrap.hasClass( 'wp-responsive-open' ) ) { 1703 return; 1704 } 1705 1706 // A brief delay is required to allow focus to switch to another element. 1707 setTimeout( function() { 1708 focusIsInToggle = $.contains( $( '#wp-admin-bar-menu-toggle' )[0], $( ':focus' )[0] ); 1709 focusIsInSidebar = $.contains( $( '#adminmenumain' )[0], $( ':focus' )[0] ); 1710 1711 if ( ! focusIsInToggle && ! focusIsInSidebar ) { 1712 $( '#wp-admin-bar-menu-toggle' ).trigger( 'click.wp-responsive' ); 1713 } 1714 }, 10 ); 1715 } ); 1716 1698 1717 // Add menu events. 1699 1718 $adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
Note: See TracChangeset
for help on using the changeset viewer.