From 73e91b1ad3adcf5268a206795efaf0c5262f33eb Mon Sep 17 00:00:00 2001 From: Ella Iseulde Van Dorpe Date: Wed, 25 May 2016 15:12:28 +0000 Subject: [PATCH] TinyMCE: fix inline toolbar positioning Introduced in [37000]. See https://github.com/tinymce/tinymce/commit/2fb8aa48e91101bd3ca4ff2d532bca3a8665fb24. See https://github.com/tinymce/tinymce/commit/5734a8d8805d69ee87dd1cad7263244968194601. Fixes #36876. git-svn-id: https://develop.svn.wordpress.org/trunk@37559 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wordpress/plugin.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 ); } );