Media: When the attachment details view changes to another view or attachment, save compat fields on destroy. (We already do this for non-compat fields.) props koopersmith. fixes #22776.
git-svn-id: http://core.svn.wordpress.org/trunk@23098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1aca97360e
commit
2d9b708b6e
|
@ -4080,6 +4080,13 @@
|
|||
this.model.on( 'change:compat', this.render, this );
|
||||
},
|
||||
|
||||
dispose: function() {
|
||||
if ( this.$(':focus').length )
|
||||
this.save();
|
||||
|
||||
return media.View.prototype.dispose.apply( this, arguments );
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var compat = this.model.get('compat');
|
||||
if ( ! compat || ! compat.item )
|
||||
|
@ -4100,6 +4107,7 @@
|
|||
save: function( event ) {
|
||||
var data = {};
|
||||
|
||||
if ( event )
|
||||
event.preventDefault();
|
||||
|
||||
_.each( this.$el.serializeArray(), function( pair ) {
|
||||
|
|
Loading…
Reference in New Issue