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.

Built from https://develop.svn.wordpress.org/trunk@39002


git-svn-id: http://core.svn.wordpress.org/trunk@38944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-10-29 05:06:31 +00:00
parent ce81b7a849
commit d71afc0d9a
3 changed files with 7 additions and 6 deletions

View File

@ -577,7 +577,7 @@
post_type: itemObject post_type: itemObject
} ); } );
promise.done( function( data ) { promise.done( function( data ) {
var availableItem, $content, itemTemplate; var availableItem, $content, itemElement;
availableItem = new api.Menus.AvailableItemModel( { availableItem = new api.Menus.AvailableItemModel( {
'id': 'post-' + data.post_id, // Used for available menu item Backbone models. 'id': 'post-' + data.post_id, // Used for available menu item Backbone models.
'title': itemName.val(), 'title': itemName.val(),
@ -594,8 +594,9 @@
// Add the new item to the list of available items. // Add the new item to the list of available items.
api.Menus.availableMenuItemsPanel.collection.add( availableItem ); api.Menus.availableMenuItemsPanel.collection.add( availableItem );
$content = container.find( '.available-menu-items-list' ); $content = container.find( '.available-menu-items-list' );
itemTemplate = wp.template( 'available-menu-item' ); itemElement = $( wp.template( 'available-menu-item' )( availableItem.attributes ) );
$content.prepend( itemTemplate( availableItem.attributes ) ); itemElement.find( '.menu-item-handle:first' ).addClass( 'item-added' );
$content.prepend( itemElement );
$content.scrollTop(); $content.scrollTop();
// Reset the create content form. // Reset the create content form.

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-beta1-39001'; $wp_version = '4.7-beta1-39002';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.