WordPress.org

Make WordPress Core

Changeset 31509


Ignore:
Timestamp:
02/22/2015 08:13:31 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Delegate focusin and focusout events for row actions to make sure the actions are always revealed on focus.

props afercia.
fixes #29765.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/common.js

    r31177 r31509  
    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, .tags td.column-name, .bookmarks 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, .tags td.column-name, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' );
    456461
    457462    $('#default-password-nag-no').click( function() {
Note: See TracChangeset for help on using the changeset viewer.