Make WordPress Core

Ticket #38677: 38677.diff

File 38677.diff, 2.4 KB (added by afercia, 8 years ago)
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    12671267                                __( 'Edit' )
    12681268                        );
    12691269                        $actions['inline hide-if-no-js'] = sprintf(
    1270                                 '<a href="#" class="editinline" aria-label="%s">%s</a>',
     1270                                '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
    12711271                                /* translators: %s: post title */
    12721272                                esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),
    12731273                                __( 'Quick&nbsp;Edit' )
  • src/wp-admin/js/inline-edit-post.js

     
    119119                });
    120120
    121121                /**
    122                  * Binds click event to the .editinline link which opens the quick editor.
     122                 * Binds click event to the .editinline button which opens the quick editor.
    123123                 */
    124                 $('#the-list').on( 'click', 'a.editinline', function( e ) {
    125                         e.preventDefault();
    126                         inlineEditPost.edit(this);
     124                $( '#the-list' ).on( 'click', '.editinline', function() {
     125                        $( this ).attr( 'aria-expanded', 'true' );
     126                        inlineEditPost.edit( this );
    127127                });
    128128
    129129                $('#bulk-edit').find('fieldset:first').after(
     
    422422                                                $(inlineEditPost.what+id).siblings('tr.hidden').addBack().remove();
    423423                                                $('#edit-'+id).before(r).remove();
    424424                                                $( inlineEditPost.what + id ).hide().fadeIn( 400, function() {
    425                                                         // Move focus back to the Quick Edit link. $( this ) is the row being animated.
    426                                                         $( this ).find( '.editinline' ).focus();
     425                                                        // Move focus back to the Quick Edit button. $( this ) is the row being animated.
     426                                                        $( this ).find( '.editinline' )
     427                                                                .attr( 'aria-expanded', 'false' )
     428                                                                .focus();
    427429                                                        wp.a11y.speak( inlineEditL10n.saved );
    428430                                                });
    429431                                        } else {
     
    477479                                $('#'+id).siblings('tr.hidden').addBack().remove();
    478480                                id = id.substr( id.lastIndexOf('-') + 1 );
    479481
    480                                 // Show the post row and move focus back to the Quick Edit link.
    481                                 $( this.what + id ).show().find( '.editinline' ).focus();
     482                                // Show the post row and move focus back to the Quick Edit button.
     483                                $( this.what + id ).show().find( '.editinline' )
     484                                        .attr( 'aria-expanded', 'false' )
     485                                        .focus();
    482486                        }
    483487                }
    484488