Ticket #27423: 27423.diff
File 27423.diff, 1.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/media-views.js
5199 5199 }); 5200 5200 5201 5201 this._viewsByCid = {}; 5202 this.$window = $( window ); 5203 this.resizeEvent = 'resize.media-modal-columns'; 5202 5204 5203 5205 this.collection.on( 'add', function( attachment ) { 5204 5206 this.views.add( this.createAttachmentView( attachment ), { … … 5230 5232 _.bindAll( this, 'setColumns' ); 5231 5233 5232 5234 if ( this.options.resize ) { 5233 $( window ).on( 'resize.media-modal-columns', this.setColumns );5235 this.on( 'ready', this.bindEvents ); 5234 5236 this.controller.on( 'open', this.setColumns ); 5237 5238 // Call this.setColumns() after this view has been rendered in the DOM so 5239 // attachments get proper width applied. 5240 _.defer( this.setColumns, this ); 5235 5241 } 5242 }, 5236 5243 5237 // Call this.setColumns() after this view has been rendered in the DOM so 5238 // attachments get proper width applied. 5239 _.defer( this.setColumns, this ); 5244 bindEvents: function() { 5245 this.$window.off( this.resizeEvent ).on( this.resizeEvent, this.setColumns ); 5240 5246 }, 5241 5247 5242 5248 attachmentFocus: function() { … … 5292 5298 5293 5299 dispose: function() { 5294 5300 this.collection.props.off( null, null, this ); 5295 $( window ).off( 'resize.media-modal-columns' ); 5301 if ( this.options.resize ) { 5302 this.$window.off( this.resizeEvent ); 5303 } 5296 5304 5297 5305 /** 5298 5306 * call 'dispose' directly on the parent class