Make WordPress Core

Changeset 24698


Ignore:
Timestamp:
07/13/2013 02:49:53 AM (11 years ago)
Author:
markjaquith
Message:

Revisions: RTL tooltip fixes. Plus a fix for switching to compare-two mode while looking at the first revision.

Also, a meta box avatar RTL alignment fix. props DrewAPicture.

Fixes #24739.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin-rtl.css

    r24680 r24698  
    10221022.revisions img {
    10231023    float: right;
    1024     margin-right: 0;
    1025     margin-left: 5px;
     1024    margin: 5px 0 0 5px;
    10261025}
    10271026
    10281027.revisions-tooltip {
    1029     margin-left: -185px;
     1028    margin-right: -73px;
     1029    margin-left: 0;
     1030    -webkit-transition: right 15ms;
     1031    -moz-transition:    right 15ms;
     1032    -ms-transition:     right 15ms;
     1033    -o-transition:      right 15ms;
     1034    transition:         right 15ms;
    10301035}
    10311036
    10321037.revisions-tooltip-arrow {
    1033     margin-left: 150px;
     1038    right: 0;
     1039    margin-left: 0;
     1040    margin-right: 35px;
     1041}
     1042
     1043.revisions-tooltip-image {
     1044    float: right;
     1045    margin: 2px 0 0 5px;
    10341046}
    10351047
  • trunk/wp-admin/js/revisions.js

    r24689 r24698  
    332332            this.listenTo( this, 'change:from', this.changeRevisionHandler );
    333333            this.listenTo( this, 'change:to', this.changeRevisionHandler );
     334            this.listenTo( this, 'change:compareTwoMode', this.changeMode );
    334335            this.listenTo( this, 'update:revisions', this.updatedRevisions );
    335336            this.listenTo( this.diffs, 'ensure:load', this.updateLoadingStatus );
     
    352353        updateLoadingStatus: function() {
    353354            this.set( 'loading', ! this.diff() );
     355        },
     356
     357        changeMode: function( model, value ) {
     358            // If we were on the first revision before switching, we have to bump them over one
     359            if ( value && 0 === this.revisions.indexOf( this.get('to') ) ) {
     360                this.set({
     361                    from: this.revisions.at(0),
     362                    to: this.revisions.at(1)
     363                });
     364            }
    354365        },
    355366
     
    621632            // 100 to convert to a percentage
    622633            offset = 15 + (0.7 * offset * 100 ); // Now in a percentage
    623             this.$el.css( 'left', offset + '%' );
     634            this.$el.css( isRtl ? 'right' : 'left', offset + '%' );
    624635        }
    625636    });
     
    836847                    from: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[1] - 1 : ui.values[0] )
    837848                };
    838                 movedRevision = ! isRtl && ui.value === ui.values[0] ? attributes.from : attributes.to;
     849                if ( isRtl )
     850                    movedRevision = ui.value === ui.values[1] ? attributes.from : attributes.to;
     851                else
     852                    movedRevision = ui.value === ui.values[0] ? attributes.from : attributes.to;
    839853            } else {
    840854                sliderPosition = this.getSliderPosition( ui );
Note: See TracChangeset for help on using the changeset viewer.