Make WordPress Core

Ticket #24425: 24425.draft.17.diff

File 24425.draft.17.diff, 2.7 KB (added by adamsilverstein, 12 years ago)

completes Rtl functionality, diff against current trunk

  • wp-admin/js/revisions.js

     
    350350                },
    351351
    352352                nextRevision: function() {
    353                         var toIndex = this.model.revisions.indexOf( this.model.get( 'to' ) );
     353                        var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get( 'to' ) ) - 1 : this.model.revisions.indexOf( this.model.get( 'to' ) );
    354354                        toIndex     = isRtl ? toIndex - 1 : toIndex + 1;
    355355                        this.gotoModel( toIndex );
    356356                },
    357357               
    358358                previousRevision: function() {
    359                         var toIndex = this.model.revisions.indexOf( this.model.get('to') );
     359                        var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get( 'to' ) ) - 1 : this.model.revisions.indexOf( this.model.get( 'to' ) );
    360360                        toIndex     = isRtl ? toIndex + 1 : toIndex - 1;
    361361                        this.gotoModel( toIndex );
    362362                },
     
    367367
    368368                // Check to see if the Previous or Next buttons need to be disabled or enabled
    369369                disabledButtonCheck: function() {
    370                         var maxVal   = isRtl ? 0 : this.model.revisions.length - 1,
    371                                 minVal   = isRtl ? this.model.revisions.length - 1 : 0,
     370                        var maxVal   = this.model.revisions.length - 1,
     371                                minVal   = 0,
    372372                                next     = $( '.revisions-next .button' ),
    373373                                previous = $( '.revisions-previous .button' ),
    374374                                val      = this.model.revisions.indexOf( this.model.get( 'to' ) );
     
    420420                        this.$el.slider( this.settings.toJSON() );
    421421                        this.settings.on( 'change', function( model, options ) {
    422422                                // Apply changes to slider settings here.
    423                                 this.$el.slider( { value: this.model.revisions.indexOf( this.model.get( 'to' ) ) } ); // Set handle to current to model
     423                                if ( isRtl ) {
     424                                        this.$el.slider( { // Order reversed in Rtl mode
     425                                                value: this.model.revisions.length - this.model.revisions.indexOf( this.model.get( 'to' ) ) - 1
     426                                        } );
     427                                } else {
     428                                        this.$el.slider( { // Set handle to current to model
     429                                                value: this.model.revisions.indexOf( this.model.get( 'to' ) )
     430                                        } );
     431                                }
    424432                        }, this );
    425433                        // Reset to the initially selected revision
    426434                        this.slide( '', this.settings.attributes );
  • wp-admin/css/wp-admin-rtl.css

     
    975975        left: 6px;
    976976}
    977977
    978 #toggle-revision-compare-mode {
     978.revision-toggle-compare-mode {
    979979        right: auto;
    980980        left: 0;
    981981        padding: 9px 0 0 9px;
    982982}
    983983
    984 #diff-next-revision {
     984.revisions-next {
    985985        float: left;
    986986}
    987987
    988 #diff-previous-revision {
     988.revisions-previous {
    989989        float: right;
    990990}
    991991