Make WordPress Core

Changeset 39002


Ignore:
Timestamp:
10/29/2016 05:05:33 AM (8 years ago)
Author:
westonruter
Message:

Customize: Mark newly-added page/post stubs as added (with checkmark) when they are inserted into the list of available items.

Props ryankienstra, celloexpressions.
See #34923.
Fixes #38499.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r38906 r39002  
    578578            } );
    579579            promise.done( function( data ) {
    580                 var availableItem, $content, itemTemplate;
     580                var availableItem, $content, itemElement;
    581581                availableItem = new api.Menus.AvailableItemModel( {
    582582                    'id': 'post-' + data.post_id, // Used for available menu item Backbone models.
     
    595595                api.Menus.availableMenuItemsPanel.collection.add( availableItem );
    596596                $content = container.find( '.available-menu-items-list' );
    597                 itemTemplate = wp.template( 'available-menu-item' );
    598                 $content.prepend( itemTemplate( availableItem.attributes ) );
     597                itemElement = $( wp.template( 'available-menu-item' )( availableItem.attributes ) );
     598                itemElement.find( '.menu-item-handle:first' ).addClass( 'item-added' );
     599                $content.prepend( itemElement );
    599600                $content.scrollTop();
    600601
Note: See TracChangeset for help on using the changeset viewer.