From 0086598c9b4ec9b5b5d78730383f3e737b6cdc70 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Thu, 22 Nov 2012 03:19:08 +0000 Subject: [PATCH] Media: Check to see if we need more attachments when the browser is attached to the DOM. fixes #22480, see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22806 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-views.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 04a745deec..610e4fbb26 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -2572,12 +2572,10 @@ this.css(); }, - destroy: function() { + dispose: function() { this.collection.props.off( null, null, this ); - this.collection.off( 'add remove reset', null, this ); - this.model.off( 'change:edge change:gutter', this.css, this ); $(window).off( 'resize.attachments', this._resizeCss ); - this.remove(); + media.View.prototype.dispose.apply( this, arguments ); }, css: function() { @@ -2680,11 +2678,13 @@ }).render().$el; }, this ) ); - // Then, trigger the scroll event to check if we're within the + return this; + }, + + ready: function() { + // Trigger the scroll event to check if we're within the // threshold to query for additional attachments. this.scroll(); - - return this; }, add: function( attachment, index ) {