~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-includes/js/wp-embed-template.js

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
                        share_dialog_close = document.querySelector( '.wp-embed-share-dialog-close' ),
27
27
                        share_input = document.querySelectorAll( '.wp-embed-share-input' ),
28
28
                        share_dialog_tabs = document.querySelectorAll( '.wp-embed-share-tab-button button' ),
 
29
                        featured_image = document.querySelector( '.wp-embed-featured-image img' ),
29
30
                        i;
30
31
 
31
32
                if ( share_input ) {
138
139
                 */
139
140
                sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) );
140
141
 
 
142
                // Send the document's height again after the featured image has been loaded.
 
143
                if ( featured_image ) {
 
144
                        featured_image.addEventListener( 'load', function() {
 
145
                                sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) );
 
146
                        } );
 
147
                }
 
148
 
141
149
                /**
142
150
                 * Detect clicks to external (_top) links.
143
151
                 */