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:
parent
09c4928cf7
commit
c55cdfa85d
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue