For `attachment-compat` fields, show a spinner while `wp.media.model.Attachment.saveCompat()` is firing.
Fixes #27028. Built from https://develop.svn.wordpress.org/trunk@29831 git-svn-id: http://core.svn.wordpress.org/trunk@29595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
197f0a30a4
commit
821f9f40ec
|
@ -4840,6 +4840,8 @@
|
|||
this.model.on( 'selection:single selection:unsingle', this.details, this );
|
||||
this.details( this.model, this.controller.state().get('selection') );
|
||||
}
|
||||
|
||||
this.listenTo( this.controller, 'attachment:compat:waiting attachment:compat:ready', this.updateSave );
|
||||
},
|
||||
/**
|
||||
* @returns {wp.media.view.Attachment} Returns itself to allow chaining
|
||||
|
@ -6908,7 +6910,12 @@
|
|||
data[ pair.name ] = pair.value;
|
||||
});
|
||||
|
||||
this.model.saveCompat( data );
|
||||
this.controller.trigger( 'attachment:compat:waiting', ['waiting'] );
|
||||
this.model.saveCompat( data ).always( _.bind( this.postSave, this ) );
|
||||
},
|
||||
|
||||
postSave: function() {
|
||||
this.controller.trigger( 'attachment:compat:ready', ['ready'] );
|
||||
}
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue