mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
TinyMCE wpView: fire nodeChanged when an embedded iframe is resized so we can adjust the editor height and other UI components. Props iseulde, fixes #30646.
git-svn-id: https://develop.svn.wordpress.org/trunk@31466 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -207,8 +207,18 @@ window.wp = window.wp || {};
|
||||
iframeDoc.close();
|
||||
|
||||
resize = function() {
|
||||
var $iframe, iframeDocHeight;
|
||||
|
||||
// Make sure the iframe still exists.
|
||||
iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).height() );
|
||||
if ( iframe.contentWindow ) {
|
||||
$iframe = $( iframe );
|
||||
iframeDocHeight = $( iframeDoc.body ).height();
|
||||
|
||||
if ( $iframe.height() !== iframeDocHeight ) {
|
||||
$iframe.height( iframeDocHeight );
|
||||
editor.nodeChanged();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if ( MutationObserver ) {
|
||||
|
||||
Reference in New Issue
Block a user