Make WordPress Core

Ticket #25696: 25696.patch

File 25696.patch, 1.1 KB (added by afercia, 9 years ago)
  • src/wp-admin/js/inline-edit-post.js

     
    5050                // add events
    5151                $('#the-list').on( 'click', 'a.editinline', function( e ) {
    5252                        e.preventDefault();
     53                        // Don't open a new Quick Edit form when a previous Quick Edit request has not completed yet.
     54                        if ( inlineEditPost.xhr && inlineEditPost.xhr.readyState !== 4 ) {
     55                                return;
     56                        }
    5357                        inlineEditPost.edit(this);
    5458                });
    5559
     
    264268                fields = $('#edit-'+id).find(':input').serialize();
    265269                params = fields + '&' + $.param(params);
    266270
    267                 // make ajax request
    268                 $.post( ajaxurl, params,
     271                // Abort the AJAX request if there's already one in progress.
     272                if ( inlineEditPost.xhr && inlineEditPost.xhr.readyState !== 4 ) {
     273                        inlineEditPost.xhr.abort();
     274                }
     275
     276                // Fire the AJAX request.
     277                inlineEditPost.xhr = $.post( ajaxurl, params,
    269278                        function(r) {
    270279                                $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    271280                                $( '.ac_results' ).hide();