From 850d8eb69eade5d3a5579b701993897ab80d76ce Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 16 Jul 2014 02:29:53 +0000 Subject: [PATCH] Editor scrolling: on setcontent, resize the editor after some delay to allow the browser to render the content. Props avryl, see #28328. git-svn-id: https://develop.svn.wordpress.org/trunk@29185 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wpautoresize/plugin.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js b/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js index 1854a693d8..df4bc5b7e7 100644 --- a/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js @@ -140,9 +140,13 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) { editor.on( 'init', function() { editor.dom.addClass( editor.getBody(), 'wp-autoresize' ); }); - - editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize ); - + + editor.on( 'nodechange keyup FullscreenStateChanged', resize ); + + editor.on( 'setcontent', function() { + wait( 3, 100 ); + }); + if ( editor.getParam( 'autoresize_on_init', true ) ) { editor.on( 'init', function() { // Hit it 20 times in 100 ms intervals