Make WordPress Core

Changeset 29098


Ignore:
Timestamp:
07/11/2014 06:49:12 PM (10 years ago)
Author:
wonderboymusic
Message:

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

See #24716.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-grid.js

    r29089 r29098  
    310310        },
    311311
    312         deleteAttachment: function( event ) {
     312        preDestroy: function( event ) {
    313313            event.preventDefault();
    314314
    315315            this.lastIndex = this.controller.getCurrentIndex();
    316316            this.hasNext = this.controller.hasNext();
    317 
     317        },
     318
     319        trashAttachment: function( event ) {
     320            this.preDestroy( event );
     321            media.view.Attachment.Details.prototype.trashAttachment.apply( this, arguments );
     322        },
     323
     324        deleteAttachment: function( event ) {
     325            this.preDestroy( event );
    318326            media.view.Attachment.Details.prototype.deleteAttachment.apply( this, arguments );
    319327        },
     
    503511            this.content.set( view );
    504512            // Update browser url when navigating media details
    505             this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
     513            if ( this.model ) {
     514                this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
     515            } else {
     516                this.resetRoute();
     517            }
    506518        },
    507519
Note: See TracChangeset for help on using the changeset viewer.