autosave_update_post_ID() no longer needed. Fix button enable lag. Props duck_. fixes #13400

git-svn-id: http://svn.automattic.com/wordpress/trunk@14663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-15 14:03:46 +00:00
parent 3934cd678b
commit 7162ca097e
4 changed files with 7 additions and 17 deletions

View File

@ -331,9 +331,6 @@ jQuery(document).ready( function($) {
if ( $('#postcustom').length ) {
$('#the-list').wpList( { addAfter: function( xml, s ) {
$('table#list-table').show();
if ( typeof( autosave_update_post_ID ) != 'undefined' ) {
autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
}
}, addBefore: function( s ) {
s.data += '&post_id=' + $('#post_ID').val();
return s;

File diff suppressed because one or more lines are too long

View File

@ -132,7 +132,11 @@ function autosave_saved_new(response) {
if ( res && res.responses.length && !res.errors ) {
// An ID is sent only for real auto-saves, not for autosave=0 "keepalive" saves
postID = parseInt( res.responses[0].id, 10 );
autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here
if ( !isNaN(postID) && postID > 0 ) {
notSaved = false;
jQuery('#auto_draft').val('0'); // No longer an auto-draft
}
autosave_enable_buttons();
if ( autosaveDelayPreview ) {
autosaveDelayPreview = false;
doPreview();
@ -142,17 +146,6 @@ function autosave_saved_new(response) {
}
}
function autosave_update_post_ID( postID ) {
if ( !isNaN(postID) && postID > 0 ) {
if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once
notSaved = false;
autosave_enable_buttons();
jQuery('#delete-action a.submitdelete').fadeIn();
jQuery('#hiddenaction').val('editpost');
jQuery('#auto_draft').val('0'); // No longer an auto-draft
}
}
function autosave_update_slug(post_id) {
// create slug area only if not already there
if ( 'undefined' != makeSlugeditClickable && jQuery.isFunction(makeSlugeditClickable) && !jQuery('#edit-slug-box > *').size() ) {

File diff suppressed because one or more lines are too long