Ticket #23901: 23901.5.diff
File 23901.5.diff, 2.3 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
2186 2186 continue; 2187 2187 2188 2188 $revision_from_date_author = ''; 2189 $is_current_revision = false; 2189 2190 $count++; 2190 2191 // return blank data for diffs to the left of the left handle (for right handel model) 2191 2192 // or to the right of the right handle (for left handel model) … … 2235 2236 elseif ( wp_is_post_autosave( $left_revision ) ) 2236 2237 $revision_from_date_author = sprintf( $autosavef, $revision_from_date_author ); 2237 2238 2238 if ( $revision->post_modified === $post->post_modified ) 2239 if ( $revision->post_modified === $post->post_modified ) { 2239 2240 $revision_date_author = sprintf( $currentf, $revision_date_author ); 2240 elseif ( wp_is_post_autosave( $revision ) ) 2241 $is_current_revision = true; 2242 } elseif ( wp_is_post_autosave( $revision ) ) { 2241 2243 $revision_date_author = sprintf( $autosavef, $revision_date_author ); 2244 } 2242 2245 2243 2246 /* translators: revision date short format, see http://php.net/date */ 2244 2247 $date_short_format = _x( 'j M @ G:i', 'revision date short format'); … … 2275 2278 'titleTooltip' => $revision_date_author_short, 2276 2279 'restoreLink' => urldecode( $restore_link ), 2277 2280 'revision_toload' => true, 2278 'previous_revision_id' => $previous_revision_id 2281 'previous_revision_id' => $previous_revision_id, 2282 'is_current_revision' => $is_current_revision, 2279 2283 ); 2280 2284 } 2281 2285 $previous_revision_id = $revision->ID; -
wp-admin/js/revisions.js
639 639 this.toogleCompareTwoCheckbox(); 640 640 641 641 // hide the restore button when on the last sport/current post data 642 if ( Diff.rightDiff === Diff.revisions.length ){ 643 $( '#restore' ).hide(); 644 } else { 645 $( '#restore' ).show(); 646 } 642 $( '#restore' ).toggle( ! Diff.revisions.at( Diff.rightDiff - 1 ).get( 'is_current_revision' ) ); 647 643 648 644 return this; 649 645 }, … … 709 705 lines_added: 0, 710 706 lines_deleted: 0, 711 707 scope_of_changes: 'none', 712 previous_revision_id: 0 708 previous_revision_id: 0, 709 is_current_revision: false 713 710 }, 714 711 715 712 url: function() {