Changeset 32915
- Timestamp:
- 06/23/2015 07:39:21 PM (10 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-models.js
r32125 r32915 896 896 */ 897 897 type: function( attachment ) { 898 var type = this.props.get('type'); 899 return ! type || -1 !== type.indexOf( attachment.get('type') ); 898 var type = this.props.get('type'), atts = attachment.toJSON(), mime, found; 899 900 mime = atts.mime || ( atts.file && atts.file.type ) || ''; 901 902 if ( _.isArray( type ) ) { 903 found = _.find( type, function (t) { 904 return -1 !== mime.indexOf( t ); 905 } ); 906 } else { 907 found = ! type || -1 !== mime.indexOf( type ); 908 } 909 910 return found; 900 911 }, 901 912 /** -
trunk/src/wp-includes/js/media/models/attachments.js
r31935 r32915 492 492 */ 493 493 type: function( attachment ) { 494 var type = this.props.get('type'); 495 return ! type || -1 !== type.indexOf( attachment.get('type') ); 494 var type = this.props.get('type'), atts = attachment.toJSON(), mime, found; 495 496 mime = atts.mime || ( atts.file && atts.file.type ) || ''; 497 498 if ( _.isArray( type ) ) { 499 found = _.find( type, function (t) { 500 return -1 !== mime.indexOf( t ); 501 } ); 502 } else { 503 found = ! type || -1 !== mime.indexOf( type ); 504 } 505 506 return found; 496 507 }, 497 508 /**
Note: See TracChangeset
for help on using the changeset viewer.