mirror of
git://develop.git.wordpress.org/
synced 2025-02-13 03:04:42 +01:00
Embeds: Only catch clicks from the primary mouse button in the click handler, without any modifier keys.
This ensures that Ctrl/Cmd + click to open a link in the embed iframe in a new tab works as expected. Props timhavinga, garrett-eclipse, smerriman, swissspidy, johnbillion, Mte90, iandunn, azaozz, afercia, audrasjb, SergeyBiryukov. Fixes #39097. git-svn-id: https://develop.svn.wordpress.org/trunk@49202 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4362706c10
commit
1ca7bc6718
@ -137,9 +137,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send this document's height to the parent (embedding) site.
|
||||
*/
|
||||
// Send this document's height to the parent (embedding) site.
|
||||
sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) );
|
||||
|
||||
// Send the document's height again after the featured image has been loaded.
|
||||
@ -161,9 +159,12 @@
|
||||
href = target.parentElement.getAttribute( 'href' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Send link target to the parent (embedding) site.
|
||||
*/
|
||||
// Only catch clicks from the primary mouse button, without any modifiers.
|
||||
if ( event.altKey || event.ctrlKey || event.metaKey || event.shiftKey ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Send link target to the parent (embedding) site.
|
||||
if ( href ) {
|
||||
sendEmbedMessage( 'link', href );
|
||||
e.preventDefault();
|
||||
|
Loading…
x
Reference in New Issue
Block a user