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

props gcorne.
fixes #27537.


git-svn-id: https://develop.svn.wordpress.org/trunk@27756 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-26 22:55:10 +00:00
parent 09c4928cf7
commit c55cdfa85d
1 changed files with 5 additions and 1 deletions

View File

@ -5930,11 +5930,15 @@
render: function() { render: function() {
var self = this, var self = this,
args = arguments; args = arguments;
if ( this.model.attachment && 'pending' === this.model.dfd.state() ) { 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() { this.model.dfd.done( function() {
media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args ); media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args );
self.resetFocus(); self.resetFocus();
} ).fail( function() {
self.model.attachment = false;
media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args );
self.resetFocus();
} ); } );
} else { } else {
media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments ); media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );