Check that current changes can be lost before editing another comment.
When replying to or editing a comment, double-clicking another comment will open it in quick edit and changes to the current comment are lost. Props pareshradadiya, chriscct7. Fixes #21845. Built from https://develop.svn.wordpress.org/trunk@32857 git-svn-id: http://core.svn.wordpress.org/trunk@32828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fd95002b2a
commit
4e7c057a5a
|
@ -313,8 +313,9 @@ commentReply = {
|
|||
},
|
||||
|
||||
toggle : function(el) {
|
||||
if ( $(el).css('display') != 'none' )
|
||||
$(el).find('a.vim-q').click();
|
||||
if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( adminCommentsL10n.warnQuickEdit ) ) ) {
|
||||
$( el ).find( 'a.vim-q' ).click();
|
||||
}
|
||||
},
|
||||
|
||||
revert : function() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -439,7 +439,8 @@ function wp_default_scripts( &$scripts ) {
|
|||
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
|
||||
'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
|
||||
'replyApprove' => __( 'Approve and Reply' ),
|
||||
'reply' => __( 'Reply' )
|
||||
'reply' => __( 'Reply' ),
|
||||
'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
|
||||
) );
|
||||
|
||||
$scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1 );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-alpha-32856';
|
||||
$wp_version = '4.3-alpha-32857';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue