Post locks: make sure we never overwrite a draft when it's locked, clean up wp_ajax_autosave() and make wp-refresh-post-lock a bit more robust, see #23697

git-svn-id: http://core.svn.wordpress.org/trunk@23981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2013-04-13 00:41:15 +00:00
parent 17204391be
commit 76302d7d3c
2 changed files with 13 additions and 15 deletions

View File

@@ -276,8 +276,9 @@ $(document).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
// show "editing taken over" message
wrap = $('#notification-dialog-wrap');
if ( ! wrap.is(':visible') ) {
autosave();
if ( wrap.length && ! wrap.is(':visible') ) {
if ( typeof autosave == 'function' )
autosave();
if ( received.lock_error.avatar_src ) {
avatar = $('<img class="avatar avatar-64 photo" width="64" height="64" />').attr( 'src', received.lock_error.avatar_src.replace(/&amp;/g, '&') );