Skip to:
Content

BuddyPress.org

Ticket #8270: 8270-ally-3.patch

File 8270-ally-3.patch, 1007 bytes (added by imath, 6 years ago)
  • src/bp-core/admin/js/hello.js

    diff --git src/bp-core/admin/js/hello.js src/bp-core/admin/js/hello.js
    index f6d59aef1..8324e6cc2 100644
     
    2828                                                .removeClass( 'thickbox-loading' );
    2929
    3030                $( '#TB_ajaxContent' ).prop( 'style', 'height: 100%; width: auto; padding: 0; border: none;' );
     31
     32                var tabbables = $( ':tabbable', '#TB_ajaxContent' ), lastTabbable = tabbables.last();
     33
     34                // Move the focus to the Modal's close button once the last Hello link was tabbed out.
     35                $( '#TB_window' ).on( 'keydown', function( event ) {
     36                        if ( 9 === event.keyCode && ! event.shiftKey && $( lastTabbable ).prop( 'classList' ).value === $( event.target ).prop( 'classList' ).value ) {
     37                                event.preventDefault();
     38
     39                                $( '#TB_closeWindowButton' ).focus();
     40                        }
     41
     42                        if ( 9 === event.keyCode && event.shiftKey && 'TB_closeWindowButton' === $( event.target ).prop( 'id' ) ) {
     43                                event.preventDefault();
     44
     45                                $( lastTabbable ).focus();
     46                        }
     47                } );
    3148        };
    3249
    3350        /**