WordPress.org

Make WordPress Core

Ticket #29765: 29765.2.patch

File 29765.2.patch, 1.8 KB (added by afercia, 7 years ago)

refreshed patch after r31173

  • src/wp-admin/js/common.js

     
    442442        });
    443443
    444444        // Show row actions on keyboard focus of its parent container element or any other elements contained within
    445         $( 'td.post-title, td.title, td.comment, td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){
    446                 clearTimeout( transitionTimeout );
    447                 focusedRowActions = $(this).find( '.row-actions' );
    448                 focusedRowActions.addClass( 'visible' );
    449         }).focusout(function(){
    450                 // Tabbing between post title and .row-actions links needs a brief pause, otherwise
    451                 // the .row-actions div gets hidden in transit in some browsers (ahem, Firefox).
    452                 transitionTimeout = setTimeout(function(){
    453                         focusedRowActions.removeClass( 'visible' );
    454                 }, 30);
    455         });
     445        $( '#wpbody-content' ).on({
     446                focusin: function() {
     447                        clearTimeout( transitionTimeout );
     448                        focusedRowActions = $( this ).find( '.row-actions' );
     449                        // transitionTimeout is necessary for Firefox but Chrome won't remove the CSS class without a little help.
     450                        $( '.row-actions' ).not( this ).removeClass( 'visible' );
     451                        focusedRowActions.addClass( 'visible' );
     452                },
     453                focusout: function() {
     454                        // Tabbing between post title and .row-actions links needs a brief pause, otherwise
     455                        // the .row-actions div gets hidden in transit in some browsers (ahem, Firefox).
     456                        transitionTimeout = setTimeout( function() {
     457                                focusedRowActions.removeClass( 'visible' );
     458                        }, 30 );
     459                }
     460        }, 'td.post-title, td.title, td.comment, td.column-name, td.blogname, td.username, .dashboard-comment-wrap' );
    456461
    457462        $('#default-password-nag-no').click( function() {
    458463                setUserSetting('default_password_nag', 'hide');