X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4feeb71a9d812a9ae371c28a3d8b442a4394ded7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/js/wp-embed-template.js diff --git a/wp-includes/js/wp-embed-template.js b/wp-includes/js/wp-embed-template.js index 60ea47d3..16f67080 100644 --- a/wp-includes/js/wp-embed-template.js +++ b/wp-includes/js/wp-embed-template.js @@ -26,6 +26,7 @@ share_dialog_close = document.querySelector( '.wp-embed-share-dialog-close' ), share_input = document.querySelectorAll( '.wp-embed-share-input' ), share_dialog_tabs = document.querySelectorAll( '.wp-embed-share-tab-button button' ), + featured_image = document.querySelector( '.wp-embed-featured-image img' ), i; if ( share_input ) { @@ -138,6 +139,13 @@ */ sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) ); + // Send the document's height again after the featured image has been loaded. + if ( featured_image ) { + featured_image.addEventListener( 'load', function() { + sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) ); + } ); + } + /** * Detect clicks to external (_top) links. */