Send the 'wp-remove-post-lock' XHR only when the main window is unloaded (unloading the Thickbox iframe triggers it too), see #18515

git-svn-id: http://svn.automattic.com/wordpress/trunk@19258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-11 19:52:12 +00:00
parent a37b440bac
commit ca9e43f1c4
3 changed files with 8 additions and 3 deletions

View File

@ -48,9 +48,14 @@ jQuery(document).ready( function($) {
}
};
$(window).unload( function() {
$(window).unload( function(e) {
if ( ! autosaveLockRelease )
return;
// unload fires (twice) on removing the Thickbox iframe. Make sure we process only the main document unload.
if ( e.target && e.target.nodeName != '#document' )
return;
$.ajax({
type: 'POST',
url: ajaxurl,

File diff suppressed because one or more lines are too long

View File

@ -101,7 +101,7 @@ function wp_default_scripts( &$scripts ) {
'close' => __('Close'),
) );
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111013', 1 );
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111111', 1 );
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20110521', 1 );