Changeset 52591
- Timestamp:
- 01/17/2022 07:53:32 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/common.js
r52406 r52591 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 1717 1698 // Add menu events. 1718 1699 $adminmenu.on( 'click.wp-responsive', 'li.wp-has-submenu > a', function( event ) {
Note: See TracChangeset
for help on using the changeset viewer.