diff --git src/js/media/models/query.js src/js/media/models/query.js
index 4a6810adf6..2c9fceee46 100644
|
|
|
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
| 243 | 243 | var args = {}, |
| 244 | 244 | orderby = Query.orderby, |
| 245 | 245 | defaults = Query.defaultProps, |
| 246 | | query, |
| 247 | | cache = !! props.cache || _.isUndefined( props.cache ); |
| | 246 | query; |
| 248 | 247 | |
| 249 | 248 | // Remove the `query` property. This isn't linked to a query, |
| 250 | 249 | // this *is* the query. |
| 251 | 250 | delete props.query; |
| 252 | | delete props.cache; |
| 253 | 251 | |
| 254 | 252 | // Fill default args. |
| 255 | 253 | _.defaults( props, defaults ); |
| … |
… |
Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ |
| 288 | 286 | // Substitute exceptions specified in orderby.keymap. |
| 289 | 287 | args.orderby = orderby.valuemap[ props.orderby ] || props.orderby; |
| 290 | 288 | |
| 291 | | // Search the query cache for a matching query. |
| 292 | | if ( cache ) { |
| 293 | | query = _.find( queries, function( query ) { |
| 294 | | return _.isEqual( query.args, args ); |
| 295 | | }); |
| 296 | | } else { |
| 297 | | queries = []; |
| 298 | | } |
| | 289 | queries = []; |
| 299 | 290 | |
| 300 | 291 | // Otherwise, create a new query and add it to the cache. |
| 301 | 292 | if ( ! query ) { |