WordPress.org

Make WordPress Core

Changeset 39018


Ignore:
Timestamp:
10/30/2016 02:58:47 PM (3 years ago)
Author:
westonruter
Message:

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

See #38532, #27403.
Fixes #38554.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-selective-refresh.js

    r38973 r39018  
    10251025
    10261026            body.on( 'click', function( event ) {
    1027                 if ( $( event.target ).is( '.customize-partial-edit-shortcut, :input, a[href]' ) || 0 !== $( event.target ).closest( 'a' ).length ) {
    1028                     return; // Don't toggle shortcuts on form, link, or link child clicks.
     1027                if ( event.shiftKey || $( event.target ).is( '.customize-partial-edit-shortcut, :input, button *, a[href], a[href] *, object, object *, [tabindex], [tabindex] *' ) ) {
     1028                    return; // Don't toggle shortcuts on shift-clicks or clicks on (or in) interactive elements.
    10291029                }
    10301030                api.selectiveRefresh.editShortcutVisibility.set( 'visible' === api.selectiveRefresh.editShortcutVisibility.get() ? 'hidden' : 'visible' );
Note: See TracChangeset for help on using the changeset viewer.