Ticket #24736: 24736.10.patch
File 24736.10.patch, 22.2 KB (added by , 12 years ago) |
---|
-
wp-admin/css/colors-classic.css
table.diff .diff-addedline ins { 1486 1486 } 1487 1487 1488 1488 .revisions-tooltip, 1489 .revisions-tooltip-arrow :after{1489 .revisions-tooltip-arrow span { 1490 1490 border-color: #d1e5ee; 1491 1491 background-color: #fff; 1492 1492 } -
wp-admin/css/colors-fresh.css
table.diff .diff-addedline ins { 1380 1380 } 1381 1381 1382 1382 .revisions-tooltip, 1383 .revisions-tooltip-arrow :after{1383 .revisions-tooltip-arrow span { 1384 1384 border-color: #d7d7d7; 1385 1385 background-color: #fff; 1386 1386 } -
wp-admin/css/ie.css
table.ie-fixed { 630 630 * html #adminmenu div.wp-menu-image { 631 631 height: 29px; 632 632 } 633 634 /* Revisions */ 635 .revisions-tooltip-arrow span { 636 left: 25px; 637 top: -24px; 638 filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE7 */ 639 } 640 641 .revisions-controls .revisions-tickmarks > div { 642 margin-right: -1px; 643 border-width: 0 0 0 0; 644 border-style: none; 645 } 646 No newline at end of file -
wp-admin/css/wp-admin-rtl.css
th.sorted a span { 954 954 /*------------------------------------------------------------------------------ 955 955 11.2 - Post Revisions 956 956 ------------------------------------------------------------------------------*/ 957 .wp-slider .ui-slider-handle. left-handle:before,958 .wp-slider .ui-slider-handle. right-handle:before {957 .wp-slider .ui-slider-handle.from-handle:before, 958 .wp-slider .ui-slider-handle.to-handle:before { 959 959 height: 8px; 960 960 width: 7px; 961 961 } 962 962 963 .wp-slider .ui-slider-handle. left-handle:before {963 .wp-slider .ui-slider-handle.from-handle:before { 964 964 background-position: -5px -10px; 965 965 left: 6px; 966 966 } 967 967 968 .wp-slider .ui-slider-handle. right-handle:before {968 .wp-slider .ui-slider-handle.to-handle:before { 969 969 background-position: -4px -29px; 970 970 left: 6px; 971 971 } … … th.sorted a span { 1025 1025 } 1026 1026 1027 1027 .revisions-tooltip { 1028 margin-right: -73px;1029 1028 margin-left: 0; 1029 margin-right: -70px; 1030 1030 -webkit-transition: right 15ms; 1031 1031 -moz-transition: right 15ms; 1032 1032 -ms-transition: right 15ms; … … th.sorted a span { 1040 1040 margin-right: 35px; 1041 1041 } 1042 1042 1043 .revisions-tooltip-image { 1043 .revisions-tooltip-arrow > span { 1044 right: 20px; 1045 } 1046 1047 .revisions-tooltip img { 1044 1048 float: right; 1045 1049 margin: 2px 0 0 5px; 1046 1050 } 1047 1051 1052 .revisions-tickmarks > div { 1053 float: right; 1054 border-width: 0 0 0 1px; 1055 } 1056 1048 1057 /*------------------------------------------------------------------------------ 1049 1058 11.3 - Featured Images 1050 1059 ------------------------------------------------------------------------------*/ -
wp-admin/css/wp-admin.css
td.plugin-title p { 3500 3500 /*------------------------------------------------------------------------------ 3501 3501 11.2 - Post Revisions 3502 3502 ------------------------------------------------------------------------------*/ 3503 body.revision-php {3504 overflow-y: scroll; /* Force a scrollbar, so centering doesn't jump */3505 }3506 3507 3503 .revisions-control-frame, 3508 3504 .revisions-diff-frame { 3509 3505 position: relative; … … body.revision-php { 3522 3518 3523 3519 .revisions-tickmarks { 3524 3520 position: relative; 3525 margin: 0 auto 0;3521 margin: 0 auto; 3526 3522 height: 0.8em; 3527 3523 z-index: 2; 3528 3524 top: 7px; 3529 3525 width: 70%; 3530 3526 -moz-box-sizing: border-box; 3531 3527 -webkit-box-sizing: border-box; 3532 -ms-box-sizing: border-box; /* ie8 only */3533 3528 box-sizing: border-box; 3534 3529 } 3535 3530 … … body.revision-php { 3539 3534 float: left; 3540 3535 z-index: 10002; 3541 3536 border-style: solid; 3542 border-width: 0 0 0 1px;3537 border-width: 0 1px 0 0; 3543 3538 -moz-box-sizing: border-box; 3544 3539 -webkit-box-sizing: border-box; 3545 -ms-box-sizing: border-box; /* ie8 only */3546 3540 box-sizing: border-box; 3547 3541 } 3548 3542 3549 .revisions-tickmarks > div: first-of-type{3550 border- left-width: 0;3543 .revisions-tickmarks > div:last-child { 3544 border-width: 0; 3551 3545 } 3552 3546 3553 3547 .comparing-two-revisions .revisions-controls { … … body.revision-php { 3559 3553 text-align: center; 3560 3554 vertical-align: middle; 3561 3555 opacity: 0; 3556 filter: alpha(opacity=0); 3562 3557 margin: 0 auto; 3563 3558 width: 100%; 3564 3559 height: 32px; … … body.revision-php { 3569 3564 -ms-transition: opacity 0.5s; 3570 3565 -o-transition: opacity 0.5s; 3571 3566 transition: opacity 0.5s; 3567 filter: alpha(opacity=0); /* ie8 and earlier */ 3572 3568 } 3573 3569 3574 3570 .revisions.loading .loading-indicator { 3575 3571 opacity: 1; 3572 filter: alpha(opacity=100); /* ie8 and earlier */ 3576 3573 } 3577 3574 3578 3575 .revisions .diff { … … body.revision-php { 3585 3582 3586 3583 .revisions.loading .diff { 3587 3584 opacity: 0.5; 3585 filter: alpha(opacity=50); /* ie8 and earlier */ 3588 3586 } 3589 3587 3590 3588 .revisions-meta { … … body.revision-php { 3612 3610 3613 3611 .wp-slider { 3614 3612 width: 70%; 3615 margin: 0 auto 0;3613 margin: 0 auto; 3616 3614 top: -3px; 3617 3615 } 3618 3616 … … table.diff .diff-addedline ins { 3705 3703 } 3706 3704 3707 3705 .revisions-tooltip { 3708 position: absolute; 3709 bottom: 105px; 3710 margin-left: -69px; 3706 position: fixed; 3707 margin-bottom: 22px; 3708 margin-right: 0; 3709 margin-left: -70px; 3711 3710 line-height: 28px; 3712 3711 z-index: 9999; 3713 3712 max-width: 350px; … … table.diff .diff-addedline ins { 3744 3743 z-index: 10000; 3745 3744 } 3746 3745 3747 .revisions-tooltip-arrow :after{3746 .revisions-tooltip-arrow > span { 3748 3747 content: ""; 3749 3748 position: absolute; 3750 3749 left: 20px; … … table.diff .diff-addedline ins { 3758 3757 tranform: rotate(45deg); 3759 3758 } 3760 3759 3760 .ie8 .revisions-tooltip-arrow > span { 3761 left: 14px; 3762 top: -25px; 3763 -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */ 3764 } 3765 3761 3766 .revisions-tooltip, 3762 .revisions-tooltip-arrow :after{3767 .revisions-tooltip-arrow > span { 3763 3768 border-width: 1px; 3764 3769 border-style: solid; 3765 3770 } … … div.revisions-controls > .wp-slider > .ui-slider-handle { 3799 3804 background: url(../images/arrows-pr.png) no-repeat -2px -47px; 3800 3805 } 3801 3806 3802 .wp-slider .ui-slider-handle. left-handle:before,3803 .wp-slider .ui-slider-handle. right-handle:before {3807 .wp-slider .ui-slider-handle.from-handle:before, 3808 .wp-slider .ui-slider-handle.to-handle:before { 3804 3809 height: 8px; 3805 3810 width: 7px; 3806 3811 } 3807 3812 3808 .wp-slider .ui-slider-handle. left-handle:before {3813 .wp-slider .ui-slider-handle.from-handle:before { 3809 3814 background-position: -5px -84px; 3810 3815 left: 7px; 3811 3816 } 3812 3817 3813 .wp-slider .ui-slider-handle. right-handle:before {3818 .wp-slider .ui-slider-handle.to-handle:before { 3814 3819 background-position: -4px -65px; 3815 3820 left: 5px; 3816 3821 } -
wp-admin/js/revisions.js
window.wp = window.wp || {}; 16 16 console.log.apply( console, arguments ); 17 17 }; 18 18 19 // Handy function to help with positioning 20 $.fn.allOffsets = function() { 21 var offset = this.offset() || {top: 0, left: 0}, win = $(window); 22 return _.extend( offset, { 23 right: win.outerWidth() - offset.left - this.outerWidth(), 24 bottom: win.outerHeight() - offset.top - this.outerHeight() 25 }); 26 }; 27 19 28 // wp_localize_script transforms top-level numbers into strings. Undo that. 20 29 if ( revisions.settings.to ) 21 30 revisions.settings.to = parseInt( revisions.settings.to, 10 ); … … window.wp = window.wp || {}; 125 134 revisions.model.Tooltip = Backbone.Model.extend({ 126 135 defaults: { 127 136 revision: null, 137 offset: {}, 128 138 hovering: false, // Whether the mouse is hovering 129 139 scrubbing: false // Whether the mouse is scrubbing 130 140 }, 131 141 132 142 initialize: function( options ) { 143 this.frame = options.frame; 133 144 this.revisions = options.revisions; 134 145 this.slider = options.slider; 135 146 136 147 this.listenTo( this.slider, 'hovered:revision', this.updateRevision ); 137 148 this.listenTo( this.slider, 'change:hovering', this.setHovering ); 138 149 this.listenTo( this.slider, 'change:scrubbing', this.setScrubbing ); 150 151 this.set({ revision: this.frame.diff() }); 139 152 }, 140 153 154 141 155 updateRevision: function( revision ) { 142 156 this.set({ revision: revision }); 143 157 }, … … window.wp = window.wp || {}; 452 466 render: function() { 453 467 wp.Backbone.View.prototype.render.apply( this, arguments ); 454 468 469 $('html').css( 'overflow-y', 'scroll' ); 455 470 $('#wpbody-content .wrap').append( this.el ); 456 471 this.updateCompareTwoMode(); 457 472 this.renderDiff( this.model.diff() ); … … window.wp = window.wp || {}; 497 512 revisions: this.model.revisions 498 513 }); 499 514 515 // Prep the tooltip model 516 var tooltip = new revisions.model.Tooltip({ 517 frame: this.model, 518 revisions: this.model.revisions, 519 slider: slider 520 }); 521 500 522 // Add the tooltip view 501 523 this.views.add( new revisions.view.Tooltip({ 502 model: new revisions.model.Tooltip({ 503 revisions: this.model.revisions, 504 slider: slider 505 }) 524 model: tooltip 506 525 }) ); 507 526 508 527 // Add the tickmarks view 509 528 this.views.add( new revisions.view.Tickmarks({ 510 model: t his.model529 model: tooltip 511 530 }) ); 512 531 513 532 // Add the slider view … … window.wp = window.wp || {}; 527 546 revisions.view.Tickmarks = wp.Backbone.View.extend({ 528 547 className: 'revisions-tickmarks', 529 548 549 initialize: function() { 550 this.listenTo( this.model, 'change:revision', this.reportTickPosition ); 551 }, 552 553 reportTickPosition: function( model, revision ) { 554 var elWidth, offset, tick, index = this.model.revisions.indexOf( revision ); 555 if ( index === this.model.revisions.length - 1 ) { 556 // Last one 557 offset = this.$el.allOffsets(); 558 elWidth = this.$el.outerWidth(); 559 // adjust 560 _.extend( offset, { 561 right: offset.right + elWidth + 1, 562 left: offset.left + elWidth + 1 563 }); 564 } else { 565 // Normal tick 566 tick = this.$('div:nth-of-type(' + (index + 1) + ')'); 567 offset = tick.allOffsets(); 568 } 569 this.model.set({ offset: offset }); 570 }, 571 530 572 ready: function() { 531 573 var tickCount, tickWidth; 532 574 tickCount = this.model.revisions.length - 1; 533 575 tickWidth = 1 / tickCount; 534 576 535 577 _(tickCount).times( function(){ this.$el.append( '<div></div>' ); }, this ); 578 536 579 this.$('div').css( 'width', ( 100 * tickWidth ) + '%' ); 537 580 } 538 581 }); … … window.wp = window.wp || {}; 598 641 revisions.view.Tooltip = wp.Backbone.View.extend({ 599 642 className: 'revisions-tooltip', 600 643 template: wp.template('revisions-tooltip'), 644 direction: isRtl ? 'right' : 'left', 601 645 602 646 initialize: function( options ) { 603 this.listenTo( this.model, 'change: revision', this.render );647 this.listenTo( this.model, 'change:offset', this.render ); 604 648 this.listenTo( this.model, 'change:hovering', this.toggleVisibility ); 605 649 this.listenTo( this.model, 'change:scrubbing', this.toggleVisibility ); 606 650 }, 607 651 652 prepare: function() { 653 return this.model.get('revision').toJSON(); 654 }, 655 656 render: function() { 657 var css = {}; 658 wp.Backbone.View.prototype.render.apply( this, arguments ); 659 css[this.direction] = this.model.get('offset')[this.direction] + 'px'; 660 css.bottom = this.model.get('offset').bottom + 'px'; 661 this.$el.css( css ); 662 }, 663 608 664 visible: function() { 609 665 return this.model.get( 'scrubbing' ) || this.model.get( 'hovering' ); 610 666 }, … … window.wp = window.wp || {}; 615 671 else 616 672 this.$el.stop().fadeTo( this.el.style.opacity * 300, 0, function(){ $(this).hide(); } ); 617 673 return; 618 },619 620 render: function() {621 var offset;622 // Check if a revision exists.623 if ( _.isNull( this.model.get('revision') ) )624 return;625 626 this.$el.html( this.template( this.model.get('revision').toJSON() ) );627 628 // Set the position.629 offset = this.model.revisions.indexOf( this.model.get('revision') ) / ( this.model.revisions.length - 1 );630 // 15% to get us to the start of the slider631 // 0.7 to convert the slider-relative percentage to a page-relative percentage632 // 100 to convert to a percentage633 offset = 15 + (0.7 * offset * 100 ); // Now in a percentage634 this.$el.css( isRtl ? 'right' : 'left', offset + '%' );635 674 } 636 675 }); 637 676 … … window.wp = window.wp || {}; 654 693 this.disabledButtonCheck(); 655 694 }, 656 695 657 // Go to a specific model index, taking into account RTL mode.696 // Go to a specific model index 658 697 gotoModel: function( toIndex ) { 659 698 var attributes = { 660 to: this.model.revisions.at( isRtl ? this.model.revisions.length - toIndex - 1 : toIndex ) // Reverse directions for RTL.699 to: this.model.revisions.at( toIndex ) 661 700 }; 662 701 // If we're at the first revision, unset 'from'. 663 if ( isRtl ? this.model.revisions.length - toIndex - 1 : toIndex ) // Reverse directions for RTL664 attributes.from = this.model.revisions.at( isRtl ? this.model.revisions.length - toIndex - 2 :toIndex - 1 );702 if ( toIndex ) 703 attributes.from = this.model.revisions.at( toIndex - 1 ); 665 704 else 666 705 this.model.unset('from', { silent: true }); 667 706 668 707 this.model.set( attributes ); 669 708 }, 670 709 671 // Go to the 'next' revision , direction takes into account RTL mode.710 // Go to the 'next' revision 672 711 nextRevision: function() { 673 var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get('to') ) - 1 : this.model.revisions.indexOf( this.model.get('to') ); 674 toIndex = isRtl ? toIndex - 1 : toIndex + 1; 712 var toIndex = this.model.revisions.indexOf( this.model.get('to') ) + 1; 675 713 this.gotoModel( toIndex ); 676 714 }, 677 715 678 // Go to the 'previous' revision , direction takes into account RTL mode.716 // Go to the 'previous' revision 679 717 previousRevision: function() { 680 var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get('to') ) - 1 : this.model.revisions.indexOf( this.model.get('to') ); 681 toIndex = isRtl ? toIndex + 1 : toIndex - 1; 718 var toIndex = this.model.revisions.indexOf( this.model.get('to') ) - 1; 682 719 this.gotoModel( toIndex ); 683 720 }, 684 721 … … window.wp = window.wp || {}; 702 739 // The slider view. 703 740 revisions.view.Slider = wp.Backbone.View.extend({ 704 741 className: 'wp-slider', 742 direction: isRtl ? 'right' : 'left', 705 743 706 744 events: { 707 745 'mousemove' : 'mouseMove' … … window.wp = window.wp || {}; 730 768 731 769 mouseMove: function( e ) { 732 770 var zoneCount = this.model.revisions.length - 1, // One fewer zone than models 733 slider Left = this.$el.offset().left, // Leftedge of slider771 sliderFrom = this.$el.allOffsets()[this.direction], // "From" edge of slider 734 772 sliderWidth = this.$el.width(), // Width of slider 735 773 tickWidth = sliderWidth / zoneCount, // Calculated width of zone 736 actualX = e.clientX - sliderLeft, // Offset of mouse position in slider 737 currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 ) ) / tickWidth ); // Calculate the model index 738 739 // Reverse direction in RTL mode. 740 if ( isRtl ) 741 currentModelIndex = this.model.revisions.length - currentModelIndex - 1; 774 actualX = e.pageX - sliderFrom; // Offset of mouse position in slider 775 actualX = isRtl ? sliderWidth - actualX : actualX; 776 var currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 ) ) / tickWidth ); // Calculate the model index 742 777 743 778 // Ensure sane value for currentModelIndex. 744 779 if ( currentModelIndex < 0 ) … … window.wp = window.wp || {}; 746 781 else if ( currentModelIndex >= this.model.revisions.length ) 747 782 currentModelIndex = this.model.revisions.length - 1; 748 783 749 // Update the tooltip mode l784 // Update the tooltip mode 750 785 this.model.set({ hoveredRevision: this.model.revisions.at( currentModelIndex ) }); 751 786 }, 752 787 … … window.wp = window.wp || {}; 765 800 if ( this.model.get('compareTwoMode') ) { 766 801 // in RTL mode the 'left handle' is the second in the slider, 'right' is first 767 802 handles.first() 768 .toggleClass( ' right-handle', !! isRtl )769 .toggleClass( ' left-handle', ! isRtl );803 .toggleClass( 'to-handle', !! isRtl ) 804 .toggleClass( 'from-handle', ! isRtl ); 770 805 handles.last() 771 .toggleClass( ' left-handle', !! isRtl )772 .toggleClass( ' right-handle', ! isRtl );806 .toggleClass( 'from-handle', !! isRtl ) 807 .toggleClass( 'to-handle', ! isRtl ); 773 808 } else { 774 handles.removeClass(' left-handle right-handle');809 handles.removeClass('from-handle to-handle'); 775 810 } 776 811 }, 777 812 778 getSliderPosition: function( ui ){779 return isRtl ? this.model.revisions.length - ui.value - 1 : ui.value;780 },781 782 813 start: function( event, ui ) { 783 814 this.model.set({ scrubbing: true }); 784 815 785 816 // Track the mouse position to enable smooth dragging, 786 817 // overrides default jQuery UI step behavior. 787 818 $( window ).on( 'mousemove.wp.revisions', { view: this }, function( e ) { 788 var view = e.data.view, 789 leftDragBoundary = view.$el.offset().left, // Initial left boundary 790 sliderOffset = leftDragBoundary, 791 sliderRightEdge = leftDragBoundary + view.$el.width(), 792 rightDragBoundary = sliderRightEdge, // Initial right boundary 793 leftDragReset = 0, // Initial left drag reset 794 rightDragReset = sliderRightEdge - sliderOffset; // Initial right drag reset 819 var view = e.data.view, 820 leftDragBoundary = view.$el.offset().left, 821 sliderOffset = leftDragBoundary, 822 sliderRightEdge = leftDragBoundary + view.$el.width(), 823 rightDragBoundary = sliderRightEdge, 824 leftDragReset = '0', 825 rightDragReset = '100%', 826 handle = $( ui.handle ); 795 827 796 828 // In two handle mode, ensure handles can't be dragged past each other. 797 829 // Adjust left/right boundaries and reset points. 798 830 if ( view.model.get('compareTwoMode') ) { 799 var rightHandle = $( ui.handle ).parent().find('.right-handle'), 800 leftHandle = $( ui.handle ).parent().find('.left-handle'); 801 802 if ( $( ui.handle ).hasClass('left-handle') ) { 803 // Dragging the left handle, boundary is right handle. 804 // RTL mode calculations reverse directions. 805 if ( isRtl ) { 806 leftDragBoundary = rightHandle.offset().left + rightHandle.width(); 807 leftDragReset = leftDragBoundary - sliderOffset; 808 } else { 809 rightDragBoundary = rightHandle.offset().left; 810 rightDragReset = rightDragBoundary - sliderOffset; 811 } 812 } else { 813 // Dragging the right handle, boundary is the left handle. 814 // RTL mode calculations reverse directions. 815 if ( isRtl ) { 816 rightDragBoundary = leftHandle.offset().left; 817 rightDragReset = rightDragBoundary - sliderOffset; 818 } else { 819 leftDragBoundary = leftHandle.offset().left + leftHandle.width() ; 820 leftDragReset = leftDragBoundary - sliderOffset; 821 } 831 var handles = handle.parent().find('.ui-slider-handle'); 832 if ( handle.is( handles.first() ) ) { // We're the left handle 833 rightDragBoundary = handles.last().offset().left; 834 rightDragReset = rightDragBoundary - sliderOffset; 835 } else { // We're the right handle 836 leftDragBoundary = handles.first().offset().left + handles.first().width(); 837 leftDragReset = leftDragBoundary - sliderOffset; 822 838 } 823 839 } 824 840 825 841 // Follow mouse movements, as long as handle remains inside slider. 826 if ( e. clientX < leftDragBoundary ) {827 $( ui.handle ).css( 'left', leftDragReset ); // Mouse to left of slider.828 } else if ( e. clientX > rightDragBoundary ) {829 $( ui.handle ).css( 'left', rightDragReset ); // Mouse to right of slider.842 if ( e.pageX < leftDragBoundary ) { 843 handle.css( 'left', leftDragReset ); // Mouse to left of slider. 844 } else if ( e.pageX > rightDragBoundary ) { 845 handle.css( 'left', rightDragReset ); // Mouse to right of slider. 830 846 } else { 831 $( ui.handle ).css( 'left', e.clientX - sliderOffset ); // Mouse in slider.847 handle.css( 'left', e.pageX - sliderOffset ); // Mouse in slider. 832 848 } 833 849 } ); 834 850 }, 835 851 852 getPosition: function( position ) { 853 return isRtl ? this.model.revisions.length - position - 1: position; 854 }, 855 836 856 // Responds to slide events 837 857 slide: function( event, ui ) { 838 var attributes, movedRevision , sliderPosition;858 var attributes, movedRevision; 839 859 // Compare two revisions mode 840 860 if ( this.model.get('compareTwoMode') ) { 841 861 // Prevent sliders from occupying same spot 842 862 if ( ui.values[1] === ui.values[0] ) 843 863 return false; 844 864 if ( isRtl ) 865 ui.values.reverse(); 845 866 attributes = { 846 to: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[0] - 1 : ui.values[1]),847 from: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[1] - 1 : ui.values[0])867 from: this.model.revisions.at( this.getPosition( ui.values[0] ) ), 868 to: this.model.revisions.at( this.getPosition( ui.values[1] ) ) 848 869 }; 849 if ( isRtl )850 movedRevision = ui.value === ui.values[1] ? attributes.from : attributes.to;851 else852 movedRevision = ui.value === ui.values[0] ? attributes.from : attributes.to;853 870 } else { 854 sliderPosition = this.getSliderPosition( ui );855 871 attributes = { 856 to: this.model.revisions.at( sliderPosition)872 to: this.model.revisions.at( this.getPosition( ui.value ) ) 857 873 }; 858 movedRevision = attributes.to;859 874 // If we're at the first revision, unset 'from'. 860 if ( sliderPosition ) // Reverse directions for RTL.861 attributes.from = this.model.revisions.at( sliderPosition - 1);875 if ( this.getPosition( ui.value ) > 0 ) 876 attributes.from = this.model.revisions.at( this.getPosition( ui.value ) - 1 ); 862 877 else 863 878 attributes.from = undefined; 864 879 } 880 movedRevision = this.model.revisions.at( this.getPosition( ui.value ) ); 865 881 866 882 // If we are scrubbing, a scrub to a revision is considered a hover 867 883 if ( this.model.get('scrubbing') ) -
wp-admin/revision.php
require_once( './admin-header.php' ); 138 138 ({{{ data.dateShort }}}) 139 139 <# } #> 140 140 </div> 141 <div class="revisions-tooltip-arrow">< /div>141 <div class="revisions-tooltip-arrow"><span></span></div> 142 142 </script> 143 143 144 144 <script id="tmpl-revisions-checkbox" type="text/html">