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:
Andrew Ozz 2015-02-15 18:18:06 +00:00
parent 73a85825fb
commit 0dd81fe134
1 changed files with 11 additions and 1 deletions

View File

@ -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 ) {