diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 7d7d90c759..66863a356b 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2130,16 +2130,6 @@ function wp_ajax_revisions_data() { if ( 0 != $single_revision_id ) { $right_revision = get_post( $single_revision_id ); - // - //make sure the left revision is the most recent - // - - if ( strtotime( $right_revision->post_modified_gmt ) < strtotime( $left_revision->post_modified_gmt ) ) { - $temp = $left_revision; - $left_revision = $right_revision; - $right_revision = $temp; - } - $linesadded=0; $linesdeleted=0; @@ -2182,14 +2172,6 @@ function wp_ajax_revisions_data() { exit(); } //end single model fetch - //fetch the list of revisions available - - //if we are comparing two revisions, the first 'revision' represented by the leftmost - //slider position is the current revision, prepend a comparison to this revision - if ( ! wp_first_revision_matches_current_version( $post_id ) ) //revisions don't have current version - array_unshift( $revisions, get_post( $post_id ) ) ; - //$revisions->append ( get_post( $post_id ) ); - //error_log( var_dump( $revisions )); $count = -1; //reverse the list to start with oldes revision diff --git a/wp-admin/js/revisions.js b/wp-admin/js/revisions.js index 4e48ed11f5..6ac4b86e9e 100644 --- a/wp-admin/js/revisions.js +++ b/wp-admin/js/revisions.js @@ -465,12 +465,12 @@ window.wp = window.wp || {}; // add tooltips to the handles if ( 2 === REVAPP._compareOneOrTwo ) { REVAPP.addTooltip ( $( 'a.ui-slider-handle.left-handle' ), - ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._leftDiff ).get( 'revision_date_author_short' ) ); + ( REVAPP._leftDiff < 0 ) ? '' : REVAPP._revisions.at( REVAPP._leftDiff - 1 ).get( 'revision_date_author_short' ) ); REVAPP.addTooltip ( $( 'a.ui-slider-handle.right-handle' ), - ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) ); + ( REVAPP._rightDiff > REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff - 1 ).get( 'revision_date_author_short' ) ); } else { REVAPP.addTooltip ( $( 'a.ui-slider-handle' ), - ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) ); + ( REVAPP._rightDiff > REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff - 1 ).get( 'revision_date_author_short' ) ); } // hide the restore button when on the last sport/current post data