]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/edit-comments.js
WordPress 4.5
[autoinstalls/wordpress.git] / wp-admin / js / edit-comments.js
index 7fc62deb73688f65589fe93c5aa64fe8c212cecf..f201362bf0040a898362b2f89e4736fcdcd021d7 100644 (file)
@@ -286,6 +286,7 @@ setCommentsList = function() {
 
                        a.click(function( e ){
                                e.preventDefault();
+                               e.stopPropagation(); // ticket #35904
                                list.wpList.del(this);
                                $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
                                        $(this).remove();
@@ -313,7 +314,8 @@ setCommentsList = function() {
                        approved = commentRow.hasClass( 'approved' ),
                        unapproved = commentRow.hasClass( 'unapproved' ),
                        spammed = commentRow.hasClass( 'spam' ),
-                       trashed = commentRow.hasClass( 'trash' );
+                       trashed = commentRow.hasClass( 'trash' ),
+                       undoing = false; // ticket #35904
 
                updateDashboardText( newTotal );
 
@@ -347,6 +349,8 @@ setCommentsList = function() {
                                }
                        }
 
+                       undoing = true;
+
                // user clicked "Spam"
                } else if ( targetParent.is( 'span.spam' ) ) {
                        // the comment is currently approved
@@ -481,7 +485,7 @@ setCommentsList = function() {
                        }
                }
 
-               if ( ! theExtraList || theExtraList.size() === 0 || theExtraList.children().size() === 0 ) {
+               if ( ! theExtraList || theExtraList.length === 0 || theExtraList.children().length === 0 || undoing ) {
                        return;
                }