Properly render the image details modal when the image references an invalid attachment.

props gcorne.
fixes #27537.

Built from https://develop.svn.wordpress.org/trunk@27756


git-svn-id: http://core.svn.wordpress.org/trunk@27593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-26 22:56:14 +00:00
parent f947924b0a
commit ed993e4c5c
2 changed files with 6 additions and 2 deletions

View File

@ -5930,11 +5930,15 @@
render: function() {
var self = this,
args = arguments;
if ( this.model.attachment && 'pending' === this.model.dfd.state() ) {
// should instead show a spinner when the attachment is new and then add a listener that updates on change
this.model.dfd.done( function() {
media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args );
self.resetFocus();
} ).fail( function() {
self.model.attachment = false;
media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args );
self.resetFocus();
} );
} else {
media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );

File diff suppressed because one or more lines are too long