WordPress.org

Make WordPress Core

Changeset 36575


Ignore:
Timestamp:
02/18/2016 05:49:21 PM (4 years ago)
Author:
ocean90
Message:

Media Library: After [36546] restore the "Add new" functionality.

Rework handling of the 'toggle:upload:attachment' event using .on vs .listenTo for better compatibility with the current version of Backbone.

Props adamsilverstein.
See #34350.
Fixes #35853.

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

Legend:

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

    r36166 r36575  
    37553755        });
    37563756
    3757         this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
     3757        this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this );
    37583758        this.controller.on( 'edit:selection', this.editSelection );
    37593759        this.createToolbar();
  • trunk/src/wp-includes/js/media/views/attachments/browser.js

    r33337 r36575  
    3939        });
    4040
    41         this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
     41        this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this );
    4242        this.controller.on( 'edit:selection', this.editSelection );
    4343        this.createToolbar();
Note: See TracChangeset for help on using the changeset viewer.