Make WordPress Core

Ticket #24736: 24736.patch.diff

File 24736.patch.diff, 3.2 KB (added by adamsilverstein, 12 years ago)

better patch name

  • wp-admin/js/revisions.js

     
    580580        // The tickmarks view
    581581        revisions.view.Tickmarks = wp.Backbone.View.extend({
    582582                className: 'revisions-tickmarks',
     583                direction: isRtl ? 'right' : 'left',
    583584
    584585                initialize: function() {
    585586                        this.listenTo( this.model, 'change:revision', this.reportTickPosition );
    586587                },
    587588
    588589                reportTickPosition: function( model, revision ) {
    589                         var elWidth, offset, tick, index = this.model.revisions.indexOf( revision );
     590                        var offset, tick, index = this.model.revisions.indexOf( revision ),
     591                                divOffset = this.$el.offset();
    590592                        if ( index === this.model.revisions.length - 1 ) {
    591593                                // Last one
    592                                 tick = this.$('div:nth-of-type(' + index + ')');
     594                                tick = this.$('div:nth-of-type(' + ( index ) + ')');
    593595                                offset = tick.allPositions();
    594                                 elWidth = tick.outerWidth();
    595                                 // adjust
     596
     597                                // Position final tick at right edge of slider
    596598                                _.extend( offset, {
    597                                         right: offset.right + elWidth + 1,
    598                                         left: offset.left + elWidth + 1
    599                                 });
     599                                        left: this.$el.width() - 1,
     600                                        right: this.$el.width()
     601                                } );
    600602                        } else {
    601603                                // Normal tick
    602604                                tick = this.$('div:nth-of-type(' + (index + 1) + ')');
     
    610612                        tickCount = this.model.revisions.length - 1;
    611613                        tickWidth = 1 / tickCount;
    612614
    613                         _(tickCount).times( function(){ this.$el.append( '<div></div>' ); }, this );
     615                        _(tickCount).times( function( index ) {
     616                                this.$el.append( '<div style="' + this.direction + ': ' + ( 100 * tickWidth * index ) + '%;"></div>' );
     617                        }, this );
    614618
    615                         this.$('div').css( 'width', ( 100 * tickWidth ) + '%' );
    616619                }
    617620        });
    618621
  • wp-admin/css/wp-admin-rtl.css

     
    10261026
    10271027.revisions-tooltip {
    10281028        margin-left: 0;
    1029         margin-right: -70px;
     1029        margin-right: 118px;
    10301030        -webkit-transition: right 15ms;
    10311031        -moz-transition:    right 15ms;
    1032         -ms-transition:     right 15ms;
     1032        -9ms-transition:     right 15ms;
    10331033        -o-transition:      right 15ms;
    10341034        transition:         right 15ms;
    10351035}
  • wp-admin/css/wp-admin.css

     
    35323532        margin: 0 auto;
    35333533        height: 0.8em;
    35343534        top: 7px;
    3535         width: 100%;
    3536         padding: 0 15%;
     3535        width: 70%;
     3536        padding: 0;
    35373537        -moz-box-sizing: border-box;
    35383538        -webkit-box-sizing: border-box;
    35393539        box-sizing: border-box;
    35403540}
    35413541
    35423542.revisions-tickmarks > div {
    3543         position: relative;
     3543        position: absolute;
    35443544        height: 100%;
    3545         float: left;
    35463545        border-style: solid;
    35473546        border-width: 0 1px 0 0;
    35483547        -moz-box-sizing: border-box;
     
    35503549        box-sizing: border-box;
    35513550}
    35523551
    3553 .revisions-tickmarks > div:last-child {
    3554         border-width: 0;
    3555 }
    3556 
    35573552.comparing-two-revisions .revisions-controls {
    35583553        height: 140px;
    35593554}
     
    37393734        position: absolute;
    37403735        bottom: 105px;
    37413736        margin-right: 0;
    3742         margin-left: -70px;
     3737        margin-left: 118px;
    37433738        line-height: 28px;
    37443739        z-index: 1;
    3745         max-width: 350px;
     3740        max-width: 250px;
    37463741        min-width: 130px;
    37473742        padding: 4px;
    37483743        display: none;