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

props afercia.
fixes #29765.

git-svn-id: https://develop.svn.wordpress.org/trunk@31509 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-02-22 20:13:31 +00:00
parent 2dd6c6e696
commit a468005276

View File

@ -442,17 +442,22 @@ $(document).ready( function() {
}); });
// Show row actions on keyboard focus of its parent container element or any other elements contained within // Show row actions on keyboard focus of its parent container element or any other elements contained within
$( 'td.post-title, td.title, td.comment, .tags td.column-name, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){ $( '#wpbody-content' ).on({
clearTimeout( transitionTimeout ); focusin: function() {
focusedRowActions = $(this).find( '.row-actions' ); clearTimeout( transitionTimeout );
focusedRowActions.addClass( 'visible' ); focusedRowActions = $( this ).find( '.row-actions' );
}).focusout(function(){ // transitionTimeout is necessary for Firefox, but Chrome won't remove the CSS class without a little help.
// Tabbing between post title and .row-actions links needs a brief pause, otherwise $( '.row-actions' ).not( this ).removeClass( 'visible' );
// the .row-actions div gets hidden in transit in some browsers (ahem, Firefox). focusedRowActions.addClass( 'visible' );
transitionTimeout = setTimeout(function(){ },
focusedRowActions.removeClass( 'visible' ); focusout: function() {
}, 30); // Tabbing between post title and .row-actions links needs a brief pause, otherwise
}); // the .row-actions div gets hidden in transit in some browsers (ahem, Firefox).
transitionTimeout = setTimeout( function() {
focusedRowActions.removeClass( 'visible' );
}, 30 );
}
}, 'td.post-title, td.title, td.comment, .tags td.column-name, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' );
$('#default-password-nag-no').click( function() { $('#default-password-nag-no').click( function() {
setUserSetting('default_password_nag', 'hide'); setUserSetting('default_password_nag', 'hide');