Ticket #42530: 42530.2.diff
File 42530.2.diff, 1.2 KB (added by , 7 years ago) |
---|
-
src/wp-admin/js/editor.js
623 623 624 624 edTools = $( '#wp-content-editor-tools' ), 625 625 edToolsHeight = 0, 626 edToolsOffsetTop = 0; 626 edToolsOffsetTop = 0, 627 628 $scrollArea; 627 629 628 630 if ( edTools.length ) { 629 631 edToolsHeight = edTools.height(); … … 648 650 * subtracting the height. This gives the scroll position where the top of the editor tools aligns with 649 651 * the top of the viewport (under the Master Bar) 650 652 */ 651 var adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight ); 653 var adjustedScroll; 654 if ( editor.settings.wp_autoresize_on ) { 655 $scrollArea = $( 'html,body' ); 656 adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight ); 657 } else { 658 $scrollArea = $( editor.contentDocument ).find( 'html,body' ); 659 adjustedScroll = elementTop; 660 } 652 661 653 $ ( 'html,body' ).animate( {662 $scrollArea.animate( { 654 663 scrollTop: parseInt( adjustedScroll, 10 ) 655 664 }, 100 ); 656 665 }