Ticket #24736: 24736.20.patch
File 24736.20.patch, 4.0 KB (added by , 11 years ago) |
---|
-
wp-admin/js/revisions.js
28 28 $.fn.allPositions = function() { 29 29 var position = this.position() || {top: 0, left: 0}, parent = this.parent(); 30 30 return _.extend( position, { 31 right: parent.o uterWidth() - position.left - this.outerWidth(),31 right: parent.offset().left + parent.outerWidth() - position.left - 1, 32 32 bottom: parent.outerHeight() - position.top - this.outerHeight() 33 33 }); 34 34 }; … … 580 580 // The tickmarks view 581 581 revisions.view.Tickmarks = wp.Backbone.View.extend({ 582 582 className: 'revisions-tickmarks', 583 direction: isRtl ? 'right' : 'left', 583 584 584 585 initialize: function() { 585 586 this.listenTo( this.model, 'change:revision', this.reportTickPosition ); 586 587 }, 587 588 588 589 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(); 590 592 if ( index === this.model.revisions.length - 1 ) { 591 593 // Last one 592 tick = this.$('div:nth-of-type(' + index+ ')');594 tick = this.$('div:nth-of-type(' + ( index ) + ')'); 593 595 offset = tick.allPositions(); 594 elWidth = tick.outerWidth(); 595 // adjust596 597 // Adjust 596 598 _.extend( offset, { 597 right: offset.right + elWidth +1,598 left: offset.left + elWidth + 1599 } );599 left: this.$el.offset().left + this.$el.width() - this.$el.parent().offset().left - 1, 600 right: this.$el.offset().left + this.$el.width() 601 } ); 600 602 } else { 601 603 // Normal tick 602 604 tick = this.$('div:nth-of-type(' + (index + 1) + ')'); 603 605 offset = tick.allPositions(); 606 _.extend( offset, { 607 left: offset.left + this.$el.offset().left - this.$el.parent().offset().left 608 } ); 609 604 610 } 605 611 this.model.set({ offset: offset }); 606 612 }, … … 610 616 tickCount = this.model.revisions.length - 1; 611 617 tickWidth = 1 / tickCount; 612 618 613 _(tickCount).times( function(){ this.$el.append( '<div></div>' ); }, this ); 619 _(tickCount).times( function( index ) { 620 this.$el.append( '<div style="' + this.direction + ': ' + ( 100 * tickWidth * index ) + '%;"></div>' ); 621 }, this ); 614 622 615 this.$('div').css( 'width', ( 100 * tickWidth ) + '%' );616 623 } 617 624 }); 618 625 -
wp-admin/css/wp-admin-rtl.css
1026 1026 1027 1027 .revisions-tooltip { 1028 1028 margin-left: 0; 1029 margin-right: - 70px;1029 margin-right: -84px; 1030 1030 -webkit-transition: right 15ms; 1031 1031 -moz-transition: right 15ms; 1032 1032 -ms-transition: right 15ms; -
wp-admin/css/wp-admin.css
3527 3527 vertical-align: text-bottom; 3528 3528 } 3529 3529 3530 .revisions-tickmarks { 3530 .revisions-tickmarks, 3531 .revisions-tooltip-container { 3531 3532 position: relative; 3532 3533 margin: 0 auto; 3533 3534 height: 0.8em; 3534 3535 top: 7px; 3535 width: 100%;3536 padding: 0 15%;3536 width: 70%; 3537 padding: 0; 3537 3538 -moz-box-sizing: border-box; 3538 3539 -webkit-box-sizing: border-box; 3539 3540 box-sizing: border-box; 3540 3541 } 3541 3542 3542 3543 .revisions-tickmarks > div { 3543 position: relative;3544 position: absolute; 3544 3545 height: 100%; 3545 float: left;3546 3546 border-style: solid; 3547 3547 border-width: 0 1px 0 0; 3548 3548 -moz-box-sizing: border-box; … … 3550 3550 box-sizing: border-box; 3551 3551 } 3552 3552 3553 .revisions-tickmarks > div:last-child {3554 border-width: 0;3555 }3556 3557 3553 .comparing-two-revisions .revisions-controls { 3558 3554 height: 140px; 3559 3555 } … … 3737 3733 3738 3734 .revisions-tooltip { 3739 3735 position: absolute; 3740 bottom: 10 5px;3736 bottom: 104px; 3741 3737 margin-right: 0; 3742 margin-left: - 70px;3738 margin-left: -69px; 3743 3739 line-height: 28px; 3744 3740 z-index: 1; 3745 max-width: 350px;3741 max-width: 250px; 3746 3742 min-width: 130px; 3747 3743 padding: 4px; 3748 3744 display: none;