correct a revision/tooltip mismatch.
props adamsilverstein. see #23497 git-svn-id: http://core.svn.wordpress.org/trunk@23831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fd602a987b
commit
6b79783e63
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue