Make WordPress Core

Ticket #28819: 28819.diff

File 28819.diff, 1.1 KB (added by ericlewis, 11 years ago)
  • src/wp-includes/js/media-grid.js

    diff --git a/src/wp-includes/js/media-grid.js b/src/wp-includes/js/media-grid.js
    index 67f4dc5..9fb41f2 100644
    a b  
    426426
    427427                initialize: function() {
    428428                        var self = this;
    429                         media.view.Frame.prototype.initialize.apply( this, arguments );
    430429
     430                        media.view.Frame.prototype.initialize.apply( this, arguments );
    431431                        _.defaults( this.options, {
    432432                                modal: true,
    433433                                state: 'edit-attachment'
     
    435435
    436436                        this.gridRouter = this.options.gridRouter;
    437437                        this.library = this.options.library;
     438
    438439                        if ( this.options.model ) {
    439440                                this.model = this.options.model;
    440441                        } else {
    441442                                this.model = this.library.at( 0 );
    442443                        }
     444                        // Close the modal if the attachment is deleted.
     445                        this.listenTo( this.model, 'destroy', this.close, this );
    443446
    444447                        this.createStates();
    445448
     
    449452
    450453                        // Bind default title creation.
    451454                        this.on( 'title:create:default', this.createTitle, this );
    452                         this.title.mode('default');
     455                        this.title.mode( 'default' );
    453456
    454457                        this.options.hasPrevious = this.hasPrevious();
    455458                        this.options.hasNext = this.hasNext();