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

See #38532, #27403.
Fixes #38554.


git-svn-id: https://develop.svn.wordpress.org/trunk@39018 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2016-10-30 14:58:47 +00:00
parent 509df810bf
commit 7382bdd6b3
1 changed files with 2 additions and 2 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() );