Media Grid: after [29085], also handle `MEDIA_TRASH`.

See #24716.


git-svn-id: https://develop.svn.wordpress.org/trunk@29098 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-07-11 18:49:12 +00:00
parent f498128aa9
commit effde9e96b
1 changed files with 14 additions and 2 deletions

View File

@ -309,12 +309,20 @@
this.model.on( 'sync', this.afterDelete, this );
},
deleteAttachment: function( event ) {
preDestroy: function( event ) {
event.preventDefault();
this.lastIndex = this.controller.getCurrentIndex();
this.hasNext = this.controller.hasNext();
},
trashAttachment: function( event ) {
this.preDestroy( event );
media.view.Attachment.Details.prototype.trashAttachment.apply( this, arguments );
},
deleteAttachment: function( event ) {
this.preDestroy( event );
media.view.Attachment.Details.prototype.deleteAttachment.apply( this, arguments );
},
@ -502,7 +510,11 @@
});
this.content.set( view );
// Update browser url when navigating media details
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
if ( this.model ) {
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
} else {
this.resetRoute();
}
},
/**