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:
parent
f498128aa9
commit
effde9e96b
@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user