diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 968ebd9a6b..3ea329c608 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -902,7 +902,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { if ( activeToolbar.tempHide || event.type === 'hide' ) { activeToolbar.hide(); activeToolbar = false; - } else if ( ( event.type === 'resize' || event.type === 'scroll' ) && ! activeToolbar.blockHide ) { + } else if ( ( + event.type === 'resizewindow' || + event.type === 'scrollwindow' || + event.type === 'resize' || + event.type === 'scroll' + ) && ! activeToolbar.blockHide ) { clearTimeout( timeout ); timeout = setTimeout( function() { @@ -918,11 +923,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } } - DOM.bind( window, 'resize scroll', hide ); + // For full height editor. + editor.on( 'resizewindow scrollwindow', hide ); + // For scrollable editor. editor.dom.bind( editor.getWin(), 'resize scroll', hide ); editor.on( 'remove', function() { - DOM.unbind( window, 'resize scroll', hide ); + editor.off( 'resizewindow scrollwindow', hide ); editor.dom.unbind( editor.getWin(), 'resize scroll', hide ); } );