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:
@@ -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
Reference in New Issue
Block a user