Make WordPress Core

Changeset 7788


Ignore:
Timestamp:
04/23/2008 01:55:58 AM (18 years ago)
Author:
ryan
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/autosave.js

    r7708 r7788  
    1212
    1313// called when autosaving pre-existing post
    14 function autosave_saved(response) {
     14function autosave_saved(response, keepDisabled) {
    1515    var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response
    1616    var message = '';
     
    4242    if ( message ) { jQuery('#autosave').html(message); } // update autosave message
    4343    else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); }
    44     autosave_enable_buttons(); // re-enable disabled form buttons
     44    if ( !keepDisabled ) {
     45        autosave_enable_buttons(); // re-enable disabled form buttons
     46    }
    4547    return res;
    4648}
     
    4850// called when autosaving new post
    4951function autosave_saved_new(response) {
    50     var res = autosave_saved(response); // parse the ajax response do the above
     52    var res = autosave_saved(response, true); // parse the ajax response do the above
    5153    // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID
    5254    if ( res && res.responses.length && !res.errors ) {
     
    5961            });
    6062    }
     63    autosave_enable_buttons(); // re-enable disabled form buttons
    6164}
    6265
  • trunk/wp-includes/script-loader.php

    r7777 r7788  
    4848        ) );
    4949
    50         $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080416' );
     50        $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080422' );
    5151
    5252        $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
Note: See TracChangeset for help on using the changeset viewer.