]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/media-views.js
Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / media-views.js
index 0e1ea805ec2e9c3b6a083bb0a256fffb177b1174..60f9b9361fd684819375dccd33aa345e65fee45a 100644 (file)
@@ -462,14 +462,14 @@ EditImage = wp.media.controller.State.extend({
         * @since 3.9.0
         */
        activate: function() {
-               this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
+               this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) );
        },
 
        /**
         * @since 3.9.0
         */
        deactivate: function() {
-               this.stopListening( this.frame );
+               this.frame.off( 'toolbar:render:edit-image' );
        },
 
        /**
@@ -4085,8 +4085,8 @@ AttachmentsBrowser = View.extend({
                });
 
                // Add keydown listener to the instance of the Attachments view
-               this.attachments.listenTo( this.controller, 'attachment:keydown:arrow',     this.attachments.arrowEvent );
-               this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
+               this.controller.on( 'attachment:keydown:arrow',     _.bind( this.attachments.arrowEvent, this.attachments ) );
+               this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
 
                this.views.add( this.attachments );