From db64b3d951f896023fdf2b01218302ec5446b272 Mon Sep 17 00:00:00 2001 From: azaozz Date: Wed, 22 Jan 2014 17:57:13 +0000 Subject: [PATCH] Autosave: don't disable the buttons on previewing a post, see #25272. git-svn-id: https://develop.svn.wordpress.org/trunk@27003 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/post.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/post.js b/src/wp-admin/js/post.js index 20a796fd87..77562293af 100644 --- a/src/wp-admin/js/post.js +++ b/src/wp-admin/js/post.js @@ -401,7 +401,7 @@ jQuery(document).ready( function($) { } // The form is being submitted by the user - $submitButtons = $submitpost.find( ':button, :submit, a.submitdelete, #post-preview' ).on( 'click.autosave', function( event ) { + $submitButtons = $submitpost.find( ':button, :submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) { var $button = $(this); if ( $button.prop('disabled') ) { @@ -409,7 +409,7 @@ jQuery(document).ready( function($) { return; } - if ( $button.hasClass('submitdelete') ) { + if ( $button.hasClass('submitdelete') || $button.is( '#post-preview' ) ) { return; } @@ -420,7 +420,10 @@ jQuery(document).ready( function($) { return; } - wp.autosave.server.disable(); + if ( typeof wp != 'undefined' && wp.autosave ) { + wp.autosave.server.disable(); + } + releaseLock = false; $(window).off( 'beforeunload.edit-post' );