Ticket #6707: 6707.b.diff

File 6707.b.diff, 1.5 kB (added by mdawaffe, 7 months ago)

better

  • wp-includes/js/autosave.js

    old new  
    1010        $("#post").submit(function() { $.cancel(autosavePeriodical); }); 
    1111}); 
    1212 
    13 // called when autosaving pre-existing post 
    14 function autosave_saved(response, keepDisabled) { 
     13function autosave_parse_response(response) { 
    1514        var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response 
    1615        var message = ''; 
    1716 
     
    4140        } 
    4241        if ( message ) { jQuery('#autosave').html(message); } // update autosave message 
    4342        else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } 
    44         if ( !keepDisabled ) { 
    45                 autosave_enable_buttons(); // re-enable disabled form buttons 
    46         } 
    4743        return res; 
    4844} 
    4945 
     46// called when autosaving pre-existing post 
     47function autosave_saved(response) { 
     48        autosave_parse_response(response); // parse the ajax response 
     49        autosave_enable_buttons(); // re-enable disabled form buttons 
     50} 
     51 
    5052// called when autosaving new post 
    5153function autosave_saved_new(response) { 
    52         var res = autosave_saved(response, true); // parse the ajax response do the abov
     54        var res = autosave_parse_response(response); // parse the ajax respons
    5355        // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID 
    5456        if ( res && res.responses.length && !res.errors ) { 
    5557                var tempID = jQuery('#post_ID').val();