Customize: Prevent toggling edit shortcuts when doing shift-click or when clicking on a descendent of an interactive element.

See #38532, #27403.
Fixes #38554.

Built from https://develop.svn.wordpress.org/trunk@39018


git-svn-id: http://core.svn.wordpress.org/trunk@38960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-10-30 14:59:31 +00:00
parent 328922cc82
commit ddea523daf
3 changed files with 4 additions and 4 deletions

View File

@ -1024,8 +1024,8 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
} );
body.on( 'click', function( event ) {
if ( $( event.target ).is( '.customize-partial-edit-shortcut, :input, a[href]' ) || 0 !== $( event.target ).closest( 'a' ).length ) {
return; // Don't toggle shortcuts on form, link, or link child clicks.
if ( event.shiftKey || $( event.target ).is( '.customize-partial-edit-shortcut, :input, button *, a[href], a[href] *, object, object *, [tabindex], [tabindex] *' ) ) {
return; // Don't toggle shortcuts on shift-clicks or clicks on (or in) interactive elements.
}
api.selectiveRefresh.editShortcutVisibility.set( 'visible' === api.selectiveRefresh.editShortcutVisibility.get() ? 'hidden' : 'visible' );
api.preview.send( 'edit-shortcut-visibility', api.selectiveRefresh.editShortcutVisibility.get() );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta1-39017';
$wp_version = '4.7-beta1-39018';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.