Ticket #43376: 43376.diff
| File 43376.diff, 3.5 KB (added by , 8 years ago) |
|---|
-
src/wp-admin/includes/class-wp-comments-list-table.php
635 635 if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) { 636 636 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>'; 637 637 638 $format = '< a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" aria-label="%s" href="#">%s</a>';638 $format = '<button type="button" data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s button-link" aria-expanded="false" aria-label="%s">%s</button>'; 639 639 640 640 $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick edit this comment inline' ), __( 'Quick Edit' ) ); 641 641 -
src/wp-admin/js/edit-comments.js
632 632 }, 633 633 634 634 close : function() { 635 var c, replyrow = $('#replyrow'); 635 var commentRow = $(), 636 replyRow = $( '#replyrow' ); 636 637 637 638 // replyrow is not showing? 638 if ( reply row.parent().is('#com-reply') )639 if ( replyRow.parent().is( '#com-reply' ) ) { 639 640 return; 641 } 640 642 641 if ( this.cid && this.act == 'edit-comment' ) { 642 c = $('#comment-' + this.cid); 643 c.fadeIn(300, function(){ c.show(); }).css('backgroundColor', ''); 643 if ( this.cid ) { 644 commentRow = $( '#comment-' + this.cid ); 644 645 } 645 646 647 /* 648 * When closing the Quick Edit form, show the comment row and move focus 649 * back to the Quick Edit button. 650 */ 651 if ( 'edit-comment' === this.act ) { 652 commentRow.fadeIn( 300, function() { 653 commentRow 654 .show() 655 .find( '.vim-q' ) 656 .attr( 'aria-expanded', 'false' ) 657 .focus(); 658 } ).css( 'backgroundColor', '' ); 659 } 660 661 // When closing the Reply form, move focus back to the Reply button. 662 if ( 'replyto-comment' === this.act ) { 663 commentRow.find( '.vim-r' ) 664 .attr( 'aria-expanded', 'false' ) 665 .focus(); 666 } 667 646 668 // reset the Quicktags buttons 647 669 if ( typeof QTags != 'undefined' ) 648 670 QTags.closeAllTags('replycontent'); … … 649 671 650 672 $('#add-new-comment').css('display', ''); 651 673 652 reply row.hide();653 $( '#com-reply').append( replyrow );674 replyRow.hide(); 675 $( '#com-reply' ).append( replyRow ); 654 676 $('#replycontent').css('height', '').val(''); 655 677 $('#edithead input').val(''); 656 $( '.notice-error', reply row )678 $( '.notice-error', replyRow ) 657 679 .addClass( 'hidden' ) 658 680 .find( '.error' ).empty(); 659 $( '.spinner', reply row ).removeClass( 'is-active' );681 $( '.spinner', replyRow ).removeClass( 'is-active' ); 660 682 661 683 this.cid = ''; 662 684 this.originalContent = ''; … … 960 982 } 961 983 962 984 // Quick Edit and Reply have an inline comment editor. 963 $( '#the-comment-list' ).on( 'click', '.comment-inline', function (e) { 964 e.preventDefault(); 985 $( '#the-comment-list' ).on( 'click', '.comment-inline', function() { 965 986 var $el = $( this ), 966 987 action = 'replyto'; 967 988 … … 969 990 action = $el.data( 'action' ); 970 991 } 971 992 993 $( this ).attr( 'aria-expanded', 'true' ); 972 994 commentReply.open( $el.data( 'commentId' ), $el.data( 'postId' ), action ); 973 995 } ); 974 996 });