wp/wp-includes/js/wp-embed-template.js
changeset 18 be944660c56a
parent 9 177826044cd9
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   135 
   135 
   136 		if ( window.self === window.top ) {
   136 		if ( window.self === window.top ) {
   137 			return;
   137 			return;
   138 		}
   138 		}
   139 
   139 
   140 		/**
   140 		// Send this document's height to the parent (embedding) site.
   141 		 * Send this document's height to the parent (embedding) site.
       
   142 		 */
       
   143 		sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) );
   141 		sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) );
   144 
   142 
   145 		// Send the document's height again after the featured image has been loaded.
   143 		// Send the document's height again after the featured image has been loaded.
   146 		if ( featured_image ) {
   144 		if ( featured_image ) {
   147 			featured_image.addEventListener( 'load', function() {
   145 			featured_image.addEventListener( 'load', function() {
   159 				href = target.getAttribute( 'href' );
   157 				href = target.getAttribute( 'href' );
   160 			} else {
   158 			} else {
   161 				href = target.parentElement.getAttribute( 'href' );
   159 				href = target.parentElement.getAttribute( 'href' );
   162 			}
   160 			}
   163 
   161 
   164 			/**
   162 			// Only catch clicks from the primary mouse button, without any modifiers.
   165 			 * Send link target to the parent (embedding) site.
   163 			if ( event.altKey || event.ctrlKey || event.metaKey || event.shiftKey ) {
   166 			 */
   164 				return;
       
   165 			}
       
   166 
       
   167 			// Send link target to the parent (embedding) site.
   167 			if ( href ) {
   168 			if ( href ) {
   168 				sendEmbedMessage( 'link', href );
   169 				sendEmbedMessage( 'link', href );
   169 				e.preventDefault();
   170 				e.preventDefault();
   170 			}
   171 			}
   171 		}
   172 		}