WordPress.org

Make WordPress Core

Changeset 36681


Ignore:
Timestamp:
02/24/2016 04:02:43 PM (5 years ago)
Author:
ocean90
Message:

Media: Fix broken delete/trash functionality in the library after [36546].

Props imath.
See #34350.

Location:
trunk/src/wp-includes/js
Files:
4 edited

Legend:

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

    r33342 r36681  
    151151    initialize: function() {
    152152        DeleteSelected.prototype.initialize.apply( this, arguments );
    153         this.listenTo( this.controller, 'select:activate', this.selectActivate );
    154         this.listenTo( this.controller, 'select:deactivate', this.selectDeactivate );
     153        this.controller.on( 'select:activate', this.selectActivate, this );
     154        this.controller.on( 'select:deactivate', this.selectDeactivate, this );
    155155    },
    156156
     
    198198        Button.prototype.initialize.apply( this, arguments );
    199199        if ( this.options.filters ) {
    200             this.listenTo( this.options.filters.model, 'change', this.filterChange );
    201         }
    202         this.listenTo( this.controller, 'selection:toggle', this.toggleDisabled );
     200            this.options.filters.model.on( 'change', this.filterChange, this );
     201        }
     202        this.controller.on( 'selection:toggle', this.toggleDisabled, this );
    203203    },
    204204
     
    252252
    253253        Button.prototype.initialize.apply( this, arguments );
    254         this.listenTo( this.controller, 'select:activate select:deactivate', this.toggleBulkEditHandler );
    255         this.listenTo( this.controller, 'selection:action:done', this.back );
     254        this.controller.on( 'select:activate select:deactivate', this.toggleBulkEditHandler, this );
     255        this.controller.on( 'selection:action:done', this.back, this );
    256256    },
    257257
  • trunk/src/wp-includes/js/media/views/button/delete-selected-permanently.js

    r33337 r36681  
    1818    initialize: function() {
    1919        DeleteSelected.prototype.initialize.apply( this, arguments );
    20         this.listenTo( this.controller, 'select:activate', this.selectActivate );
    21         this.listenTo( this.controller, 'select:deactivate', this.selectDeactivate );
     20        this.controller.on( 'select:activate', this.selectActivate, this );
     21        this.controller.on( 'select:deactivate', this.selectDeactivate, this );
    2222    },
    2323
  • trunk/src/wp-includes/js/media/views/button/delete-selected.js

    r33337 r36681  
    1818        Button.prototype.initialize.apply( this, arguments );
    1919        if ( this.options.filters ) {
    20             this.listenTo( this.options.filters.model, 'change', this.filterChange );
     20            this.options.filters.model.on( 'change', this.filterChange, this );
    2121        }
    22         this.listenTo( this.controller, 'selection:toggle', this.toggleDisabled );
     22        this.controller.on( 'selection:toggle', this.toggleDisabled, this );
    2323    },
    2424
  • trunk/src/wp-includes/js/media/views/button/select-mode-toggle.js

    r33337 r36681  
    1919
    2020        Button.prototype.initialize.apply( this, arguments );
    21         this.listenTo( this.controller, 'select:activate select:deactivate', this.toggleBulkEditHandler );
    22         this.listenTo( this.controller, 'selection:action:done', this.back );
     21        this.controller.on( 'select:activate select:deactivate', this.toggleBulkEditHandler, this );
     22        this.controller.on( 'selection:action:done', this.back, this );
    2323    },
    2424
Note: See TracChangeset for help on using the changeset viewer.