WordPress.org

Make WordPress Core

Changeset 39299


Ignore:
Timestamp:
11/18/16 20:37:50 (13 months ago)
Author:
iseulde
Message:

TinyMCE: fix automatic scroll on page load.

Set focus when new content is loaded in the editor, but not when it's the initial load.

Fixes #38511.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    r39282 r39299  
    9393 
    9494        // Replace any new markers nodes with views. 
    95         editor.on( 'setcontent', function() { 
    96             // Make sure that the editor is focussed. 
    97             // May refresh the content internally which resets the iframes. 
    98             editor.focus(); 
     95        editor.on( 'setcontent', function( event ) { 
     96            if ( event.load && ! event.initial ) { 
     97                // Make sure that the editor is focussed. 
     98                // May refresh the content internally which resets the iframes. 
     99                editor.focus(); 
     100            } 
     101 
    99102            wp.mce.views.render(); 
    100103        } ); 
Note: See TracChangeset for help on using the changeset viewer.