Changeset 30409
- Timestamp:
- 11/20/2014 11:08:11 AM (10 years ago)
- Location:
- branches/4.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0
-
branches/4.0/src/wp-includes/js/media-views.js
r29686 r30409 5851 5851 priority: -60, 5852 5852 click: function() { 5853 var model, changed = [], self = this,5853 var changed = [], removed = [], self = this, 5854 5854 selection = this.controller.state().get( 'selection' ), 5855 5855 library = this.controller.state().get( 'library' ); … … 5870 5870 } 5871 5871 5872 while ( selection.length > 0 ) { 5873 model = selection.at( 0 ); 5872 selection.each( function( model ) { 5873 if ( ! model.get( 'nonces' )['delete'] ) { 5874 removed.push( model ); 5875 return; 5876 } 5877 5874 5878 if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) { 5875 5879 model.set( 'status', 'inherit' ); 5876 5880 changed.push( model.save() ); 5877 selection.remove( model );5881 removed.push( model ); 5878 5882 } else if ( media.view.settings.mediaTrash ) { 5879 5883 model.set( 'status', 'trash' ); 5880 5884 changed.push( model.save() ); 5881 selection.remove( model );5885 removed.push( model ); 5882 5886 } else { 5883 5887 model.destroy(); 5884 5888 } 5885 } 5889 } ); 5886 5890 5887 5891 if ( changed.length ) { 5892 selection.remove( removed ); 5893 5888 5894 $.when.apply( null, changed ).then( function() { 5889 5895 library._requery( true );
Note: See TracChangeset
for help on using the changeset viewer.