Changeset 7791

Show
Ignore:
Timestamp:
04/23/08 02:23:07 (7 months ago)
Author:
ryan
Message:

Disable buttons until autosave completes. Props mdawaffe. fixes #6707 for 2.5

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.5/wp-includes/js/autosave.js

    r7789 r7791  
    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 = ''; 
     
    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; 
     44} 
     45 
     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 
    4850} 
    4951 
    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 ) {