Make WordPress Core

Changeset 36774


Ignore:
Timestamp:
02/29/2016 03:19:48 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Comments: Avoid extra AJAX requests when undoing Spam or Trash actions.

Props afercia.
Fixes #35904.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/edit-comments.js

    r36286 r36774  
    287287            a.click(function( e ){
    288288                e.preventDefault();
     289                e.stopPropagation(); // ticket #35904
    289290                list.wpList.del(this);
    290291                $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
     
    314315            unapproved = commentRow.hasClass( 'unapproved' ),
    315316            spammed = commentRow.hasClass( 'spam' ),
    316             trashed = commentRow.hasClass( 'trash' );
     317            trashed = commentRow.hasClass( 'trash' ),
     318            undoing = false; // ticket #35904
    317319
    318320        updateDashboardText( newTotal );
     
    347349                }
    348350            }
     351
     352            undoing = true;
    349353
    350354        // user clicked "Spam"
     
    482486        }
    483487
    484         if ( ! theExtraList || theExtraList.length === 0 || theExtraList.children().length === 0 ) {
     488        if ( ! theExtraList || theExtraList.length === 0 || theExtraList.children().length === 0 || undoing ) {
    485489            return;
    486490        }
Note: See TracChangeset for help on using the changeset viewer.