Make WordPress Core

Changeset 24678


Ignore:
Timestamp:
07/12/2013 05:25:27 PM (11 years ago)
Author:
markjaquith
Message:

Revisions: Have the tooltip follow the "from" scrubber handle when that is the one being moved, in compare-two mode.

See #24425.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/revisions.js

    r24671 r24678  
    828828        // Responds to slide events
    829829        slide: function( event, ui ) {
    830             var attributes;
     830            var attributes, movedRevision;
    831831            // Compare two revisions mode
    832832            if ( ! _.isUndefined( ui.values ) && this.model.get('compareTwoMode') ) {
     
    839839                    from: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[1] - 1 : ui.values[0] ) // Reverse directions for RTL.
    840840                };
    841 
     841                movedRevision = ! isRtl && ui.value === ui.values[0] ? attributes.from : attributes.to;
    842842            } else {
    843843                // Compare single revision mode
     
    846846                    to: this.model.revisions.at( sliderPosition )
    847847                };
    848 
     848                movedRevision = attributes.to;
    849849                // If we're at the first revision, unset 'from'.
    850850                if ( sliderPosition ) // Reverse directions for RTL.
     
    853853                    attributes.from = undefined;
    854854            }
     855
     856            // If we are scrubbing, a scrub to a revision is considered a hover
     857            if ( this.model.get('scrubbing') )
     858                attributes.hoveredRevision = movedRevision;
     859
    855860            this.model.set( attributes );
    856 
    857             // If we are scrubbing, a scrub to a revision is considered a hover
    858             if ( this.model.get( 'scrubbing' ) ) {
    859                 this.model.set({
    860                     'hoveredRevision': attributes.to
    861                 });
    862             }
    863861        },
    864862
Note: See TracChangeset for help on using the changeset viewer.