(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/*globals wp, _, jQuery */
-
var $ = jQuery,
Attachment, Attachments, l10n, media;
});
},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
-/*globals wp, _, Backbone */
-
/**
* wp.media.model.Attachment
*
module.exports = Attachment;
},{}],3:[function(require,module,exports){
-/*globals wp, _, Backbone */
-
/**
* wp.media.model.Attachments
*
delete this.mirroring;
},
/**
- * Retrive more attachments from the server for the collection.
+ * Retrieve more attachments from the server for the collection.
*
* Only works if the collection is mirroring a Query Attachments collection,
* and forwards to its `more` method. This collection class doesn't have
* @returns {Boolean}
*/
type: function( attachment ) {
- var type = this.props.get('type');
- return ! type || -1 !== type.indexOf( attachment.get('type') );
+ var type = this.props.get('type'), atts = attachment.toJSON(), mime, found;
+
+ if ( ! type || ( _.isArray( type ) && ! type.length ) ) {
+ return true;
+ }
+
+ mime = atts.mime || ( atts.file && atts.file.type ) || '';
+
+ if ( _.isArray( type ) ) {
+ found = _.find( type, function (t) {
+ return -1 !== mime.indexOf( t );
+ } );
+ } else {
+ found = -1 !== mime.indexOf( type );
+ }
+
+ return found;
},
/**
* @static
module.exports = Attachments;
},{}],4:[function(require,module,exports){
-/*globals Backbone */
-
/**
* wp.media.model.PostImage
*
module.exports = PostImage;
},{}],5:[function(require,module,exports){
-/*globals wp, _ */
-
/**
* wp.media.model.Query
*
module.exports = Query;
},{}],6:[function(require,module,exports){
-/*globals wp, _ */
-
/**
* wp.media.model.Selection
*