Ticket #29386: 29386.patch
File 29386.patch, 2.3 KB (added by , 10 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
388 388 echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>'; 389 389 ?></h2> 390 390 <?php if ( $notice ) : ?> 391 <div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>391 <div id="notice" class="error"><p><?php echo $notice ?></p></div> 392 392 <?php endif; ?> 393 393 <?php if ( $message ) : ?> 394 394 <div id="message" class="updated"><p><?php echo $message; ?></p></div> -
src/wp-includes/js/autosave.js
7 7 ( function( $, window ) { 8 8 function autosave() { 9 9 var initialCompareString, 10 lastTriggerSave = 0, 11 $document = $(document); 10 lastTriggerSave = 0, 11 $window = $( window ), 12 $editorWindow = $(), 13 $document = $( document ); 12 14 13 15 /** 14 16 * Returns the data saved in both local and remote autosave … … 323 325 } 324 326 325 327 // There is a newer autosave. Don't show two "restore" notices at the same time. 326 if ( $( '# has-newer-autosave' ).length ) {328 if ( $( '#notice' ).length ) { 327 329 return; 328 330 } 329 331 … … 528 530 }).on( 'heartbeat-tick.autosave', function( event, data ) { 529 531 if ( data.wp_autosave ) { 530 532 response( data.wp_autosave ); 533 534 $window.add( $editorWindow ).on( 'mousemove.autosave', function() { 535 var $notice = $( '#notice' ); 536 537 window.scrollBy( 0, -$notice.outerHeight( true ) ); 538 $notice.remove(); 539 $window.add( $editorWindow ).off( 'mousemove.autosave' ); 540 } ); 531 541 } 532 542 }).on( 'heartbeat-connection-lost.autosave', function( event, error, status ) { 533 543 // When connection is lost, keep user from submitting changes. … … 567 577 editor.save(); 568 578 initialCompareString = getCompareString(); 569 579 }, 1000 ); 580 581 $editorWindow = $( editor.getWin() ); 570 582 } 571 583 }).ready( function() { 572 584 // Set the initial compare string in case TinyMCE is not used or not loaded first