Make WordPress Core

Ticket #39100: 39100.diff

File 39100.diff, 677 bytes (added by sirbrillig, 10 years ago)

Attach edit shortcut click handler before shortcut is added

  • src/wp-includes/js/customize-selective-refresh.js

    diff --git src/wp-includes/js/customize-selective-refresh.js src/wp-includes/js/customize-selective-refresh.js
    index f6dfa0b..0735b23 100644
    wp.customize.selectiveRefresh = ( function( $, api ) {  
    121121                                return;
    122122                        }
    123123                        $shortcut = partial.createEditShortcut();
    124                         partial.addEditShortcutToPlacement( placement, $shortcut );
    125124                        $shortcut.on( 'click', function( event ) {
    126125                                event.preventDefault();
    127126                                event.stopPropagation();
    128127                                partial.showControl();
    129128                        } );
     129                        partial.addEditShortcutToPlacement( placement, $shortcut );
    130130                },
    131131
    132132                /**