Make WordPress Core

Ticket #38830: 38830.0.diff

File 38830.0.diff, 1.3 KB (added by westonruter, 10 years ago)
  • 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 e97b1cf..a106711 100644
    wp.customize.selectiveRefresh = ( function( $, api ) {  
    109109                 * @returns {void}
    110110                 */
    111111                createEditShortcutForPlacement: function( placement ) {
    112                         var partial = this, $shortcut, $placementContainer;
     112                        var partial = this, $shortcut, $placementContainer, illegalAncestorSelector, illegalContainerSelector;
    113113                        if ( ! placement.container ) {
    114114                                return;
    115115                        }
    116116                        $placementContainer = $( placement.container );
    117                         if ( ! $placementContainer.length ) {
     117                        illegalAncestorSelector = 'head';
     118                        illegalContainerSelector = 'area, audio, base, bdi, bdo, br, button, canvas, col, colgroup, command, datalist, embed, head, hr, html, iframe, img, input, keygen, label, link, map, math, menu, meta, noscript, object, optgroup, option, param, progress, rp, rt, ruby, script, select, source, style, svg, table, tbody, textarea, tfoot, thead, title, tr, track, video, wbr';
     119                        if ( ! $placementContainer.length || $placementContainer.is( illegalContainerSelector ) || $placementContainer.closest( illegalAncestorSelector ).length ) {
    118120                                return;
    119121                        }
    120122                        $shortcut = partial.createEditShortcut();