Ticket #24753: 24753.3.diff
File 24753.3.diff, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-models.js
window.wp = window.wp || {}; 401 401 402 402 attachments.on( 'add change remove', this._validateHandler, this ); 403 403 attachments.on( 'reset', this._validateAllHandler, this ); 404 405 404 this.validateAll( attachments ); 406 405 return this; 407 406 }, … … window.wp = window.wp || {}; 487 486 resp = [resp]; 488 487 489 488 return _.map( resp, function( attrs ) { 490 var id, attachment; 489 var id, attachment, newAttributes; 490 491 491 if ( attrs instanceof Backbone.Model ) { 492 492 id = attrs.get( 'id' ); 493 493 attrs = attrs.attributes; … … window.wp = window.wp || {}; 495 495 id = attrs.id; 496 496 } 497 497 498 attachment = Attachment.get( attrs.id ); 499 if ( ! _.isEqual( attachment.attributes, attrs ) ) 500 attachment.set( attachment.parse( attrs, xhr ) ); 498 attachment = Attachment.get( id ); 499 newAttributes = attachment.parse( attrs, xhr ); 500 501 if ( ! _.isEqual( attachment.attributes, newAttributes ) ) 502 attachment.set( newAttributes ); 501 503 502 504 return attachment; 503 505 });