From b5652fb180598c921be2f163ca6990d909086f6d Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Tue, 30 Oct 2012 23:41:13 +0000 Subject: [PATCH] Media JS: Properly fire the Attachment view details method on render. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22338 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-views.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 112995d294..b8b5ea4920 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -1049,7 +1049,8 @@ }, render: function() { - var attachment = this.model.toJSON(), + var state = this.controller.state(), + attachment = this.model.toJSON(), options = _.defaults( this.model.toJSON(), { orientation: 'landscape', uploading: false, @@ -1062,7 +1063,7 @@ }); options.buttons = this.buttons; - options.describe = this.controller.state().get('describe'); + options.describe = state.get('describe'); if ( 'image' === options.type ) _.extend( options, this.imageSize() ); @@ -1080,7 +1081,7 @@ // Update the model's details view. this.model.on( 'selection:single selection:unsingle', this.details, this ); - this.details(); + this.details( this.model, state.get('selection') ); return this; },