Changeset 39502
- Timestamp:
- 12/05/2016 04:46:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-nav-menus.js
r39378 r39502 80 80 }); 81 81 api.Menus.availableMenuItems = new api.Menus.AvailableItemCollection( api.Menus.data.availableMenuItems ); 82 83 api.Menus.insertedAutoDrafts = [];84 82 85 83 /** … … 105 103 request.done( function( response ) { 106 104 if ( response.post_id ) { 107 api.Menus.insertedAutoDrafts.push( response.post_id ); 108 api( 'nav_menus_created_posts' ).set( _.clone( api.Menus.insertedAutoDrafts ) ); 105 api( 'nav_menus_created_posts' ).set( 106 api( 'nav_menus_created_posts' ).get().concat( [ response.post_id ] ) 107 ); 109 108 110 109 if ( 'page' === params.post_type ) { … … 2798 2797 api.Menus.applySavedData( data ); 2799 2798 } 2800 2801 // Reset list of inserted auto draft post IDs. 2802 api.Menus.insertedAutoDrafts = []; 2799 } ); 2800 2801 /* 2802 * Reset the list of posts created in the customizer once published. 2803 * The setting is updated quietly (bypassing events being triggered) 2804 * so that the customized state doesn't become immediately dirty. 2805 */ 2806 api.state( 'changesetStatus' ).bind( function( status ) { 2807 if ( 'publish' === status ) { 2808 api( 'nav_menus_created_posts' )._value = []; 2809 } 2803 2810 } ); 2804 2811
Note: See TracChangeset
for help on using the changeset viewer.