TinyMCE: fix flickering inline toolbar when hovering over the buttons there and the vertical scrollbar is not shown (the page height is less than the window height). Improves/removes the previous fix for similar flickering but only in RTL, see #42018.

Props joakimsilfverberg, mukesh27, kokers, Howdy_McGee, noisysocks, azaozz.
Fixes #44911.
Built from https://develop.svn.wordpress.org/trunk@45610


git-svn-id: http://core.svn.wordpress.org/trunk@45421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2019-07-09 01:11:55 +00:00
parent c71bc1513e
commit 4a273484f3
8 changed files with 10 additions and 30 deletions

View File

@ -803,11 +803,6 @@ div.mce-menu .mce-menu-item-sep,
margin-top: 2px;
}
/* Don't show the tooltip. Used in Chrome RTL, see #42018 */
.rtl .mce-tooltip.wp-hide-mce-tooltip {
display: none !important;
}
.mce-tooltip-inner {
border-radius: 3px;
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);

File diff suppressed because one or more lines are too long

View File

@ -803,11 +803,6 @@ div.mce-menu .mce-menu-item-sep,
margin-top: 2px;
}
/* Don't show the tooltip. Used in Chrome RTL, see #42018 */
.rtl .mce-tooltip.wp-hide-mce-tooltip {
display: none !important;
}
.mce-tooltip-inner {
border-radius: 3px;
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);

File diff suppressed because one or more lines are too long

View File

@ -788,8 +788,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
mceIframe = document.getElementById( editor.id + '_ifr' ),
mceToolbar,
mceStatusbar,
wpStatusbar,
isChromeRtl = ( editor.rtl && /Chrome/.test( navigator.userAgent ) );
wpStatusbar;
if ( container ) {
mceToolbar = tinymce.$( '.mce-toolbar-grp', container )[0];
@ -1040,16 +1039,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
toolbar.on( 'show', function() {
this.reposition();
if ( isChromeRtl ) {
tinymce.$( '.mce-widget.mce-tooltip' ).addClass( 'wp-hide-mce-tooltip' );
}
} );
toolbar.on( 'hide', function() {
if ( isChromeRtl ) {
tinymce.$( '.mce-widget.mce-tooltip' ).removeClass( 'wp-hide-mce-tooltip' );
}
} );
toolbar.on( 'keydown', function( event ) {
@ -1140,14 +1129,15 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
}
editor.dom.bind( editor.getWin(), 'resize', hide );
if ( editor.inline ) {
editor.on( 'resizewindow', hide );
// 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 );
}
@ -1155,7 +1145,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
editor.on( 'remove', function() {
document.removeEventListener( 'scroll', hide, true );
editor.off( 'resizewindow scrollwindow', hide );
editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
editor.dom.unbind( editor.getWin(), 'scroll', hide );
} );
editor.on( 'blur hide', 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.3-alpha-45609';
$wp_version = '5.3-alpha-45610';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.