- Timestamp:
- 02/08/2017 07:43:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media/views/attachments/browser.js
r37755 r40051 226 226 priority: -55, 227 227 click: function() { 228 var removed = [], selection = this.controller.state().get( 'selection' ); 228 var removed = [], 229 destroy = [], 230 selection = this.controller.state().get( 'selection' ); 229 231 230 232 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { … … 238 240 } 239 241 240 model.destroy();242 destroy.push( model ); 241 243 } ); 242 244 243 selection.remove( removed ); 244 this.controller.trigger( 'selection:action:done' ); 245 if ( removed.length ) { 246 selection.remove( removed ); 247 } 248 249 if ( destroy.length ) { 250 $.when.apply( null, destroy.map( function (item) { 251 return item.destroy(); 252 } ) ).then( _.bind( function() { 253 this.controller.trigger( 'selection:action:done' ); 254 }, this ) ); 255 } 245 256 } 246 257 }).render() );
Note: See TracChangeset
for help on using the changeset viewer.