WordPress.org

Make WordPress Core

Changeset 23831


Ignore:
Timestamp:
03/28/2013 01:51:12 AM (7 years ago)
Author:
markjaquith
Message:

correct a revision/tooltip mismatch.

props adamsilverstein. see #23497

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r23769 r23831  
    21312131        $right_revision = get_post( $single_revision_id );
    21322132
    2133         //
    2134         //make sure the left revision is the most recent
    2135         //
    2136 
    2137         if ( strtotime( $right_revision->post_modified_gmt ) < strtotime( $left_revision->post_modified_gmt ) ) {
    2138             $temp = $left_revision;
    2139             $left_revision = $right_revision;
    2140             $right_revision = $temp;
    2141         }
    2142 
    21432133        $linesadded=0;
    21442134        $linesdeleted=0;
     
    21832173    } //end single model fetch
    21842174
    2185     //fetch the list of revisions available
    2186 
    2187     //if we are comparing two revisions, the first 'revision' represented by the leftmost
    2188     //slider position is the current revision, prepend a comparison to this revision
    2189     if ( ! wp_first_revision_matches_current_version( $post_id ) ) //revisions don't have current version
    2190         array_unshift( $revisions, get_post( $post_id ) ) ;
    2191     //$revisions->append ( get_post( $post_id ) );
    2192     //error_log( var_dump( $revisions ));
    21932175    $count = -1;
    21942176
  • trunk/wp-admin/js/revisions.js

    r23813 r23831  
    466466                if ( 2 === REVAPP._compareOneOrTwo ) {
    467467                    REVAPP.addTooltip ( $( 'a.ui-slider-handle.left-handle' ),
    468                         ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._leftDiff ).get( 'revision_date_author_short' ) );
     468                        ( REVAPP._leftDiff < 0 ) ? '' : REVAPP._revisions.at( REVAPP._leftDiff - 1 ).get( 'revision_date_author_short' ) );
    469469                    REVAPP.addTooltip ( $( 'a.ui-slider-handle.right-handle' ),
    470                         ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) );
     470                        ( REVAPP._rightDiff > REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff - 1 ).get( 'revision_date_author_short' ) );
    471471                } else {
    472472                    REVAPP.addTooltip ( $( 'a.ui-slider-handle' ),
    473                         ( REVAPP._rightDiff >= REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff ).get( 'revision_date_author_short' ) );
     473                        ( REVAPP._rightDiff > REVAPP._revisions.length ) ? '' : REVAPP._revisions.at( REVAPP._rightDiff - 1 ).get( 'revision_date_author_short' ) );
    474474                }
    475475
Note: See TracChangeset for help on using the changeset viewer.