TinyMCE: fix editor height when loaded hidden.
Props nnikolov, azaozz. Fixes #45461. Built from https://develop.svn.wordpress.org/trunk@44832 git-svn-id: http://core.svn.wordpress.org/trunk@44664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
24e2829eb9
commit
df681b2ee0
|
@ -19,7 +19,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleToolbars( state ) {
|
function toggleToolbars( state ) {
|
||||||
var initial, toolbars,
|
var initial, toolbars, iframeHeight,
|
||||||
pixels = 0,
|
pixels = 0,
|
||||||
classicBlockToolbar = tinymce.$( '.block-library-classic__toolbar' );
|
classicBlockToolbar = tinymce.$( '.block-library-classic__toolbar' );
|
||||||
|
|
||||||
|
@ -44,18 +44,24 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||||
if ( i > 0 ) {
|
if ( i > 0 ) {
|
||||||
if ( state === 'hide' ) {
|
if ( state === 'hide' ) {
|
||||||
toolbar.hide();
|
toolbar.hide();
|
||||||
pixels += 30;
|
pixels += 34;
|
||||||
} else {
|
} else {
|
||||||
toolbar.show();
|
toolbar.show();
|
||||||
pixels -= 30;
|
pixels -= 34;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize editor iframe, not needed for iOS and inline instances.
|
// Resize editor iframe, not needed for iOS and inline instances.
|
||||||
if ( pixels && ! tinymce.Env.iOS && editor.iframeElement ) {
|
// Don't resize if the editor is in a hidden container.
|
||||||
DOM.setStyle( editor.iframeElement, 'height', editor.iframeElement.clientHeight + pixels );
|
if ( pixels && ! tinymce.Env.iOS && editor.iframeElement && editor.iframeElement.clientHeight ) {
|
||||||
|
iframeHeight = editor.iframeElement.clientHeight + pixels;
|
||||||
|
|
||||||
|
// Keep min-height.
|
||||||
|
if ( iframeHeight > 50 ) {
|
||||||
|
DOM.setStyle( editor.iframeElement, 'height', iframeHeight );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! initial ) {
|
if ( ! initial ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.2-alpha-44830';
|
$wp_version = '5.2-alpha-44832';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue