Changeset 24636
- Timestamp:
- 07/10/2013 05:40:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/revisions.js
r24629 r24636 496 496 497 497 updateCompareTwoMode: function() { 498 if ( this.model.get('compareTwoMode') ) { 499 $('.compare-two-revisions').prop( 'checked', true ); 500 // in RTL mode the 'left handle' is the second in the slider, 'right' is first 501 $('.wp-slider a.ui-slider-handle').first().addClass( isRtl ? 'right-handle' : 'left-handle' ); 502 $('.wp-slider a.ui-slider-handle').last().addClass( isRtl ? 'left-handle' : 'right-handle' ); 503 } else { 504 $('.compare-two-revisions').prop( 'checked', false ); 505 $('.wp-slider a.ui-slider-handle').removeClass('left-handle').removeClass('right-handle'); 506 } 507 498 this.$('.compare-two-revisions').prop( 'checked', this.model.get('compareTwoMode') ); 508 499 }, 509 500 … … 721 712 722 713 updateSliderSettings: function() { 714 var handles; 715 723 716 if ( this.model.get('compareTwoMode') ) { 724 717 var leftValue, rightValue; … … 751 744 range: true // Range mode ensures handles can't cross 752 745 } ); 746 747 handles = this.$('a.ui-slider-handle'); 748 // in RTL mode the 'left handle' is the second in the slider, 'right' is first 749 handles.first() 750 .toggleClass( 'right-handle', !! isRtl ) 751 .toggleClass( 'left-handle', ! isRtl ); 752 handles.last() 753 .toggleClass( 'left-handle', !! isRtl ) 754 .toggleClass( 'right-handle', ! isRtl ); 755 753 756 } else { 754 757 this.$el.slider( { // Set handle to current to model 755 758 // Reverse order for RTL. 756 value: isRtl ? 759 value: isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get('to') ) - 1 : 757 760 this.model.revisions.indexOf( this.model.get('to') ), 758 761 values: null, // Clear existing two handled values 759 762 range: false 760 763 } ); 761 } 762 763 if ( this.model.get('compareTwoMode') ){ 764 // in RTL mode the 'left handle' is the second in the slider, 'right' is first 765 $( 'a.ui-slider-handle', this.$el ) 766 .first() 767 .addClass( isRtl ? 'right-handle' : 'left-handle' ) 768 .removeClass( isRtl ? 'left-handle' : 'right-handle' ); 769 $( 'a.ui-slider-handle', this.$el ) 770 .last() 771 .addClass( isRtl ? 'left-handle' : 'right-handle' ) 772 .removeClass( isRtl ? 'right-handle' : 'left-handle' ); 764 this.$('a.ui-slider-handle').removeClass('left-handle right-handle'); 773 765 } 774 766 },
Note: See TracChangeset
for help on using the changeset viewer.