TinyMCE Classic Block: fix repositioning of the inline toolbar on scrolling.

Props iseulde, azaozz.
Fixes #46062.
Built from https://develop.svn.wordpress.org/trunk@44697


git-svn-id: http://core.svn.wordpress.org/trunk@44528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2019-01-24 11:24:50 +00:00
parent a6e8abca83
commit c31e8cf756
4 changed files with 15 additions and 7 deletions

View File

@ -1064,12 +1064,20 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
}
// For full height editor.
editor.dom.bind( editor.getWin(), 'resize', hide );
if ( editor.inline ) {
// Enable `capture` for the event.
// This will hide/reposition the toolbar on any scrolling in the document.
document.addEventListener( 'scroll', hide, true );
} else {
editor.dom.bind( editor.getWin(), 'scroll', hide );
// For full height iframe editor.
editor.on( 'resizewindow scrollwindow', hide );
// For scrollable editor.
editor.dom.bind( editor.getWin(), 'resize scroll', hide );
}
editor.on( 'remove', function() {
document.removeEventListener( 'scroll', hide, true );
editor.off( 'resizewindow scrollwindow', hide );
editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
} );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta2-44696';
$wp_version = '5.1-beta2-44697';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.