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

See #24716.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-07-11 18:50:14 +00:00
parent 61d1ecba20
commit 56a70f3b64
2 changed files with 15 additions and 3 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();
}
},
/**

File diff suppressed because one or more lines are too long