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:
Konstantin Obenland
2015-06-19 13:48:25 +00:00
parent fd95002b2a
commit 4e7c057a5a
4 changed files with 7 additions and 5 deletions

View File

@@ -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() {