- Timestamp:
- 11/15/2017 12:20:21 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/editor.js
r42177 r42183 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 ); … … 582 582 removeSelectionMarker( startNode ); 583 583 removeSelectionMarker( endNode ); 584 585 editor.save(); 584 586 } 585 587 … … 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 ) { … … 649 653 * the top of the viewport (under the Master Bar) 650 654 */ 651 var adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight ); 652 653 $( 'html,body' ).animate( { 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 } 663 664 $scrollArea.animate( { 654 665 scrollTop: parseInt( adjustedScroll, 10 ) 655 666 }, 100 );
Note: See TracChangeset
for help on using the changeset viewer.