WordPress.org

Make WordPress Core

Changeset 40055 for trunk


Ignore:
Timestamp:
02/11/2017 03:34:10 AM (3 years ago)
Author:
westonruter
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.

See #39101.
Fixes #39353.

File:
1 edited

Legend:

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

    r39622 r40055  
    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.