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.



git-svn-id: https://develop.svn.wordpress.org/trunk@39299 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ella van Dorpe 2016-11-18 20:37:50 +00:00
parent 96dba32dfb
commit 1e4c6afab3
1 changed files with 7 additions and 4 deletions

View File

@ -92,10 +92,13 @@
} );
// Replace any new markers nodes with views.
editor.on( 'setcontent', function() {
// Make sure that the editor is focussed.
// May refresh the content internally which resets the iframes.
editor.focus();
editor.on( 'setcontent', function( event ) {
if ( event.load && ! event.initial ) {
// Make sure that the editor is focussed.
// May refresh the content internally which resets the iframes.
editor.focus();
}
wp.mce.views.render();
} );