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:
parent
61d1ecba20
commit
56a70f3b64
|
@ -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
Loading…
Reference in New Issue