Ticket #42530: 42530.3.diff
File 42530.3.diff, 1.6 KB (added by , 7 years ago) |
---|
-
src/wp-admin/js/editor.js
270 270 if ( shortcodes ) { 271 271 for ( var i = 0; i < shortcodes.length; i++ ) { 272 272 var shortcode = shortcodes[ i ].replace( /^\[+/g, '' ); 273 273 274 274 if ( result.indexOf( shortcode ) === -1 ) { 275 275 result.push( shortcode ); 276 276 } … … 581 581 582 582 removeSelectionMarker( startNode ); 583 583 removeSelectionMarker( endNode ); 584 585 editor.save(); 584 586 } 585 587 586 588 /** … … 623 625 624 626 edTools = $( '#wp-content-editor-tools' ), 625 627 edToolsHeight = 0, 626 edToolsOffsetTop = 0; 628 edToolsOffsetTop = 0, 629 630 $scrollArea; 627 631 628 632 if ( edTools.length ) { 629 633 edToolsHeight = edTools.height(); … … 648 652 * subtracting the height. This gives the scroll position where the top of the editor tools aligns with 649 653 * the top of the viewport (under the Master Bar) 650 654 */ 651 var adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight ); 655 var adjustedScroll; 656 if ( editor.settings.wp_autoresize_on ) { 657 $scrollArea = $( 'html,body' ); 658 adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight ); 659 } else { 660 $scrollArea = $( editor.contentDocument ).find( 'html,body' ); 661 adjustedScroll = elementTop; 662 } 652 663 653 $ ( 'html,body' ).animate( {664 $scrollArea.animate( { 654 665 scrollTop: parseInt( adjustedScroll, 10 ) 655 666 }, 100 ); 656 667 }