TinyMCE: avoid calling `editor.focus()` on loading the content in the editor. It may trigger scroll-into-view in the browser. Call the quirks fix in TinyMCE directly.

Props gitlost.
Fixes #38511.

git-svn-id: https://develop.svn.wordpress.org/trunk@39334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
azaozz 2016-11-21 20:14:01 +00:00
parent ccf9b72446
commit 48192f196f
1 changed files with 4 additions and 4 deletions

View File

@ -93,10 +93,10 @@
// Replace any new markers nodes with views.
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();
if ( event.load && ! event.initial && editor.quirks.refreshContentEditable ) {
// Make sure there is a selection in Gecko browsers.
// Or it will refresh the content internally which resets the iframes.
editor.quirks.refreshContentEditable();
}
wp.mce.views.render();