WordPress.org

Make WordPress Core

Changeset 40097


Ignore:
Timestamp:
02/21/17 06:58:37 (6 months ago)
Author:
dd32
Message:

Customize: Ensure edit shortcuts get re-created for nested partials when a parent partial is refreshed.

Fixes issue where the edit shortcut for a nav menu gets dropped when the containing Custom Menu widget is updated.

Props westonruter.
Merges [40055] to the 4.7 branch.
See #39101.
Fixes #39353.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

    r39653 r40097  
    850850        } 
    851851        containerElements.each( function() { 
    852             var containerElement = $( this ), partial, id, Constructor, partialOptions, containerContext; 
     852            var containerElement = $( this ), partial, placement, id, Constructor, partialOptions, containerContext; 
    853853            id = containerElement.data( 'customize-partial-id' ); 
    854854            if ( ! id ) { 
     
    875875            if ( options.triggerRendered && ! containerElement.data( 'customize-partial-content-rendered' ) ) { 
    876876 
     877                placement = new Placement( { 
     878                    partial: partial, 
     879                    context: containerContext, 
     880                    container: containerElement 
     881                } ); 
     882 
     883                $( placement.container ).attr( 'title', self.data.l10n.shiftClickToEdit ); 
     884                partial.createEditShortcutForPlacement( placement ); 
     885 
    877886                /** 
    878887                 * Announce when a partial's nested placement has been re-rendered. 
    879888                 */ 
    880                 self.trigger( 'partial-content-rendered', new Placement( { 
    881                     partial: partial, 
    882                     context: containerContext, 
    883                     container: containerElement 
    884                 } ) ); 
     889                self.trigger( 'partial-content-rendered', placement ); 
    885890            } 
    886891            containerElement.data( 'customize-partial-content-rendered', true ); 
Note: See TracChangeset for help on using the changeset viewer.