Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-inclu.../js
File: media-models.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ var __webpack_modules__ = ({
[1] Fix | Delete
[2] Fix | Delete
/***/ 3343:
[3] Fix | Delete
/***/ ((module) => {
[4] Fix | Delete
[5] Fix | Delete
var $ = Backbone.$,
[6] Fix | Delete
Attachment;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* wp.media.model.Attachment
[10] Fix | Delete
*
[11] Fix | Delete
* @memberOf wp.media.model
[12] Fix | Delete
*
[13] Fix | Delete
* @class
[14] Fix | Delete
* @augments Backbone.Model
[15] Fix | Delete
*/
[16] Fix | Delete
Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{
[17] Fix | Delete
/**
[18] Fix | Delete
* Triggered when attachment details change
[19] Fix | Delete
* Overrides Backbone.Model.sync
[20] Fix | Delete
*
[21] Fix | Delete
* @param {string} method
[22] Fix | Delete
* @param {wp.media.model.Attachment} model
[23] Fix | Delete
* @param {Object} [options={}]
[24] Fix | Delete
*
[25] Fix | Delete
* @return {Promise}
[26] Fix | Delete
*/
[27] Fix | Delete
sync: function( method, model, options ) {
[28] Fix | Delete
// If the attachment does not yet have an `id`, return an instantly
[29] Fix | Delete
// rejected promise. Otherwise, all of our requests will fail.
[30] Fix | Delete
if ( _.isUndefined( this.id ) ) {
[31] Fix | Delete
return $.Deferred().rejectWith( this ).promise();
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
// Overload the `read` request so Attachment.fetch() functions correctly.
[35] Fix | Delete
if ( 'read' === method ) {
[36] Fix | Delete
options = options || {};
[37] Fix | Delete
options.context = this;
[38] Fix | Delete
options.data = _.extend( options.data || {}, {
[39] Fix | Delete
action: 'get-attachment',
[40] Fix | Delete
id: this.id
[41] Fix | Delete
});
[42] Fix | Delete
return wp.media.ajax( options );
[43] Fix | Delete
[44] Fix | Delete
// Overload the `update` request so properties can be saved.
[45] Fix | Delete
} else if ( 'update' === method ) {
[46] Fix | Delete
// If we do not have the necessary nonce, fail immediately.
[47] Fix | Delete
if ( ! this.get('nonces') || ! this.get('nonces').update ) {
[48] Fix | Delete
return $.Deferred().rejectWith( this ).promise();
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
options = options || {};
[52] Fix | Delete
options.context = this;
[53] Fix | Delete
[54] Fix | Delete
// Set the action and ID.
[55] Fix | Delete
options.data = _.extend( options.data || {}, {
[56] Fix | Delete
action: 'save-attachment',
[57] Fix | Delete
id: this.id,
[58] Fix | Delete
nonce: this.get('nonces').update,
[59] Fix | Delete
post_id: wp.media.model.settings.post.id
[60] Fix | Delete
});
[61] Fix | Delete
[62] Fix | Delete
// Record the values of the changed attributes.
[63] Fix | Delete
if ( model.hasChanged() ) {
[64] Fix | Delete
options.data.changes = {};
[65] Fix | Delete
[66] Fix | Delete
_.each( model.changed, function( value, key ) {
[67] Fix | Delete
options.data.changes[ key ] = this.get( key );
[68] Fix | Delete
}, this );
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
return wp.media.ajax( options );
[72] Fix | Delete
[73] Fix | Delete
// Overload the `delete` request so attachments can be removed.
[74] Fix | Delete
// This will permanently delete an attachment.
[75] Fix | Delete
} else if ( 'delete' === method ) {
[76] Fix | Delete
options = options || {};
[77] Fix | Delete
[78] Fix | Delete
if ( ! options.wait ) {
[79] Fix | Delete
this.destroyed = true;
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
options.context = this;
[83] Fix | Delete
options.data = _.extend( options.data || {}, {
[84] Fix | Delete
action: 'delete-post',
[85] Fix | Delete
id: this.id,
[86] Fix | Delete
_wpnonce: this.get('nonces')['delete']
[87] Fix | Delete
});
[88] Fix | Delete
[89] Fix | Delete
return wp.media.ajax( options ).done( function() {
[90] Fix | Delete
this.destroyed = true;
[91] Fix | Delete
}).fail( function() {
[92] Fix | Delete
this.destroyed = false;
[93] Fix | Delete
});
[94] Fix | Delete
[95] Fix | Delete
// Otherwise, fall back to `Backbone.sync()`.
[96] Fix | Delete
} else {
[97] Fix | Delete
/**
[98] Fix | Delete
* Call `sync` directly on Backbone.Model
[99] Fix | Delete
*/
[100] Fix | Delete
return Backbone.Model.prototype.sync.apply( this, arguments );
[101] Fix | Delete
}
[102] Fix | Delete
},
[103] Fix | Delete
/**
[104] Fix | Delete
* Convert date strings into Date objects.
[105] Fix | Delete
*
[106] Fix | Delete
* @param {Object} resp The raw response object, typically returned by fetch()
[107] Fix | Delete
* @return {Object} The modified response object, which is the attributes hash
[108] Fix | Delete
* to be set on the model.
[109] Fix | Delete
*/
[110] Fix | Delete
parse: function( resp ) {
[111] Fix | Delete
if ( ! resp ) {
[112] Fix | Delete
return resp;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
resp.date = new Date( resp.date );
[116] Fix | Delete
resp.modified = new Date( resp.modified );
[117] Fix | Delete
return resp;
[118] Fix | Delete
},
[119] Fix | Delete
/**
[120] Fix | Delete
* @param {Object} data The properties to be saved.
[121] Fix | Delete
* @param {Object} options Sync options. e.g. patch, wait, success, error.
[122] Fix | Delete
*
[123] Fix | Delete
* @this Backbone.Model
[124] Fix | Delete
*
[125] Fix | Delete
* @return {Promise}
[126] Fix | Delete
*/
[127] Fix | Delete
saveCompat: function( data, options ) {
[128] Fix | Delete
var model = this;
[129] Fix | Delete
[130] Fix | Delete
// If we do not have the necessary nonce, fail immediately.
[131] Fix | Delete
if ( ! this.get('nonces') || ! this.get('nonces').update ) {
[132] Fix | Delete
return $.Deferred().rejectWith( this ).promise();
[133] Fix | Delete
}
[134] Fix | Delete
[135] Fix | Delete
return wp.media.post( 'save-attachment-compat', _.defaults({
[136] Fix | Delete
id: this.id,
[137] Fix | Delete
nonce: this.get('nonces').update,
[138] Fix | Delete
post_id: wp.media.model.settings.post.id
[139] Fix | Delete
}, data ) ).done( function( resp, status, xhr ) {
[140] Fix | Delete
model.set( model.parse( resp, xhr ), options );
[141] Fix | Delete
});
[142] Fix | Delete
}
[143] Fix | Delete
},/** @lends wp.media.model.Attachment */{
[144] Fix | Delete
/**
[145] Fix | Delete
* Create a new model on the static 'all' attachments collection and return it.
[146] Fix | Delete
*
[147] Fix | Delete
* @static
[148] Fix | Delete
*
[149] Fix | Delete
* @param {Object} attrs
[150] Fix | Delete
* @return {wp.media.model.Attachment}
[151] Fix | Delete
*/
[152] Fix | Delete
create: function( attrs ) {
[153] Fix | Delete
var Attachments = wp.media.model.Attachments;
[154] Fix | Delete
return Attachments.all.push( attrs );
[155] Fix | Delete
},
[156] Fix | Delete
/**
[157] Fix | Delete
* Create a new model on the static 'all' attachments collection and return it.
[158] Fix | Delete
*
[159] Fix | Delete
* If this function has already been called for the id,
[160] Fix | Delete
* it returns the specified attachment.
[161] Fix | Delete
*
[162] Fix | Delete
* @static
[163] Fix | Delete
* @param {string} id A string used to identify a model.
[164] Fix | Delete
* @param {Backbone.Model|undefined} attachment
[165] Fix | Delete
* @return {wp.media.model.Attachment}
[166] Fix | Delete
*/
[167] Fix | Delete
get: _.memoize( function( id, attachment ) {
[168] Fix | Delete
var Attachments = wp.media.model.Attachments;
[169] Fix | Delete
return Attachments.all.push( attachment || { id: id } );
[170] Fix | Delete
})
[171] Fix | Delete
});
[172] Fix | Delete
[173] Fix | Delete
module.exports = Attachment;
[174] Fix | Delete
[175] Fix | Delete
[176] Fix | Delete
/***/ }),
[177] Fix | Delete
[178] Fix | Delete
/***/ 8266:
[179] Fix | Delete
/***/ ((module) => {
[180] Fix | Delete
[181] Fix | Delete
/**
[182] Fix | Delete
* wp.media.model.Attachments
[183] Fix | Delete
*
[184] Fix | Delete
* A collection of attachments.
[185] Fix | Delete
*
[186] Fix | Delete
* This collection has no persistence with the server without supplying
[187] Fix | Delete
* 'options.props.query = true', which will mirror the collection
[188] Fix | Delete
* to an Attachments Query collection - @see wp.media.model.Attachments.mirror().
[189] Fix | Delete
*
[190] Fix | Delete
* @memberOf wp.media.model
[191] Fix | Delete
*
[192] Fix | Delete
* @class
[193] Fix | Delete
* @augments Backbone.Collection
[194] Fix | Delete
*
[195] Fix | Delete
* @param {array} [models] Models to initialize with the collection.
[196] Fix | Delete
* @param {object} [options] Options hash for the collection.
[197] Fix | Delete
* @param {string} [options.props] Options hash for the initial query properties.
[198] Fix | Delete
* @param {string} [options.props.order] Initial order (ASC or DESC) for the collection.
[199] Fix | Delete
* @param {string} [options.props.orderby] Initial attribute key to order the collection by.
[200] Fix | Delete
* @param {string} [options.props.query] Whether the collection is linked to an attachments query.
[201] Fix | Delete
* @param {string} [options.observe]
[202] Fix | Delete
* @param {string} [options.filters]
[203] Fix | Delete
*
[204] Fix | Delete
*/
[205] Fix | Delete
var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachments.prototype */{
[206] Fix | Delete
/**
[207] Fix | Delete
* @type {wp.media.model.Attachment}
[208] Fix | Delete
*/
[209] Fix | Delete
model: wp.media.model.Attachment,
[210] Fix | Delete
/**
[211] Fix | Delete
* @param {Array} [models=[]] Array of models used to populate the collection.
[212] Fix | Delete
* @param {Object} [options={}]
[213] Fix | Delete
*/
[214] Fix | Delete
initialize: function( models, options ) {
[215] Fix | Delete
options = options || {};
[216] Fix | Delete
[217] Fix | Delete
this.props = new Backbone.Model();
[218] Fix | Delete
this.filters = options.filters || {};
[219] Fix | Delete
[220] Fix | Delete
// Bind default `change` events to the `props` model.
[221] Fix | Delete
this.props.on( 'change', this._changeFilteredProps, this );
[222] Fix | Delete
[223] Fix | Delete
this.props.on( 'change:order', this._changeOrder, this );
[224] Fix | Delete
this.props.on( 'change:orderby', this._changeOrderby, this );
[225] Fix | Delete
this.props.on( 'change:query', this._changeQuery, this );
[226] Fix | Delete
[227] Fix | Delete
this.props.set( _.defaults( options.props || {} ) );
[228] Fix | Delete
[229] Fix | Delete
if ( options.observe ) {
[230] Fix | Delete
this.observe( options.observe );
[231] Fix | Delete
}
[232] Fix | Delete
},
[233] Fix | Delete
/**
[234] Fix | Delete
* Sort the collection when the order attribute changes.
[235] Fix | Delete
*
[236] Fix | Delete
* @access private
[237] Fix | Delete
*/
[238] Fix | Delete
_changeOrder: function() {
[239] Fix | Delete
if ( this.comparator ) {
[240] Fix | Delete
this.sort();
[241] Fix | Delete
}
[242] Fix | Delete
},
[243] Fix | Delete
/**
[244] Fix | Delete
* Set the default comparator only when the `orderby` property is set.
[245] Fix | Delete
*
[246] Fix | Delete
* @access private
[247] Fix | Delete
*
[248] Fix | Delete
* @param {Backbone.Model} model
[249] Fix | Delete
* @param {string} orderby
[250] Fix | Delete
*/
[251] Fix | Delete
_changeOrderby: function( model, orderby ) {
[252] Fix | Delete
// If a different comparator is defined, bail.
[253] Fix | Delete
if ( this.comparator && this.comparator !== Attachments.comparator ) {
[254] Fix | Delete
return;
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
if ( orderby && 'post__in' !== orderby ) {
[258] Fix | Delete
this.comparator = Attachments.comparator;
[259] Fix | Delete
} else {
[260] Fix | Delete
delete this.comparator;
[261] Fix | Delete
}
[262] Fix | Delete
},
[263] Fix | Delete
/**
[264] Fix | Delete
* If the `query` property is set to true, query the server using
[265] Fix | Delete
* the `props` values, and sync the results to this collection.
[266] Fix | Delete
*
[267] Fix | Delete
* @access private
[268] Fix | Delete
*
[269] Fix | Delete
* @param {Backbone.Model} model
[270] Fix | Delete
* @param {boolean} query
[271] Fix | Delete
*/
[272] Fix | Delete
_changeQuery: function( model, query ) {
[273] Fix | Delete
if ( query ) {
[274] Fix | Delete
this.props.on( 'change', this._requery, this );
[275] Fix | Delete
this._requery();
[276] Fix | Delete
} else {
[277] Fix | Delete
this.props.off( 'change', this._requery, this );
[278] Fix | Delete
}
[279] Fix | Delete
},
[280] Fix | Delete
/**
[281] Fix | Delete
* @access private
[282] Fix | Delete
*
[283] Fix | Delete
* @param {Backbone.Model} model
[284] Fix | Delete
*/
[285] Fix | Delete
_changeFilteredProps: function( model ) {
[286] Fix | Delete
// If this is a query, updating the collection will be handled by
[287] Fix | Delete
// `this._requery()`.
[288] Fix | Delete
if ( this.props.get('query') ) {
[289] Fix | Delete
return;
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
var changed = _.chain( model.changed ).map( function( t, prop ) {
[293] Fix | Delete
var filter = Attachments.filters[ prop ],
[294] Fix | Delete
term = model.get( prop );
[295] Fix | Delete
[296] Fix | Delete
if ( ! filter ) {
[297] Fix | Delete
return;
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
if ( term && ! this.filters[ prop ] ) {
[301] Fix | Delete
this.filters[ prop ] = filter;
[302] Fix | Delete
} else if ( ! term && this.filters[ prop ] === filter ) {
[303] Fix | Delete
delete this.filters[ prop ];
[304] Fix | Delete
} else {
[305] Fix | Delete
return;
[306] Fix | Delete
}
[307] Fix | Delete
[308] Fix | Delete
// Record the change.
[309] Fix | Delete
return true;
[310] Fix | Delete
}, this ).any().value();
[311] Fix | Delete
[312] Fix | Delete
if ( ! changed ) {
[313] Fix | Delete
return;
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
// If no `Attachments` model is provided to source the searches from,
[317] Fix | Delete
// then automatically generate a source from the existing models.
[318] Fix | Delete
if ( ! this._source ) {
[319] Fix | Delete
this._source = new Attachments( this.models );
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
this.reset( this._source.filter( this.validator, this ) );
[323] Fix | Delete
},
[324] Fix | Delete
[325] Fix | Delete
validateDestroyed: false,
[326] Fix | Delete
/**
[327] Fix | Delete
* Checks whether an attachment is valid.
[328] Fix | Delete
*
[329] Fix | Delete
* @param {wp.media.model.Attachment} attachment
[330] Fix | Delete
* @return {boolean}
[331] Fix | Delete
*/
[332] Fix | Delete
validator: function( attachment ) {
[333] Fix | Delete
[334] Fix | Delete
if ( ! this.validateDestroyed && attachment.destroyed ) {
[335] Fix | Delete
return false;
[336] Fix | Delete
}
[337] Fix | Delete
return _.all( this.filters, function( filter ) {
[338] Fix | Delete
return !! filter.call( this, attachment );
[339] Fix | Delete
}, this );
[340] Fix | Delete
},
[341] Fix | Delete
/**
[342] Fix | Delete
* Add or remove an attachment to the collection depending on its validity.
[343] Fix | Delete
*
[344] Fix | Delete
* @param {wp.media.model.Attachment} attachment
[345] Fix | Delete
* @param {Object} options
[346] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[347] Fix | Delete
*/
[348] Fix | Delete
validate: function( attachment, options ) {
[349] Fix | Delete
var valid = this.validator( attachment ),
[350] Fix | Delete
hasAttachment = !! this.get( attachment.cid );
[351] Fix | Delete
[352] Fix | Delete
if ( ! valid && hasAttachment ) {
[353] Fix | Delete
this.remove( attachment, options );
[354] Fix | Delete
} else if ( valid && ! hasAttachment ) {
[355] Fix | Delete
this.add( attachment, options );
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
return this;
[359] Fix | Delete
},
[360] Fix | Delete
[361] Fix | Delete
/**
[362] Fix | Delete
* Add or remove all attachments from another collection depending on each one's validity.
[363] Fix | Delete
*
[364] Fix | Delete
* @param {wp.media.model.Attachments} attachments
[365] Fix | Delete
* @param {Object} [options={}]
[366] Fix | Delete
*
[367] Fix | Delete
* @fires wp.media.model.Attachments#reset
[368] Fix | Delete
*
[369] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[370] Fix | Delete
*/
[371] Fix | Delete
validateAll: function( attachments, options ) {
[372] Fix | Delete
options = options || {};
[373] Fix | Delete
[374] Fix | Delete
_.each( attachments.models, function( attachment ) {
[375] Fix | Delete
this.validate( attachment, { silent: true });
[376] Fix | Delete
}, this );
[377] Fix | Delete
[378] Fix | Delete
if ( ! options.silent ) {
[379] Fix | Delete
this.trigger( 'reset', this, options );
[380] Fix | Delete
}
[381] Fix | Delete
return this;
[382] Fix | Delete
},
[383] Fix | Delete
/**
[384] Fix | Delete
* Start observing another attachments collection change events
[385] Fix | Delete
* and replicate them on this collection.
[386] Fix | Delete
*
[387] Fix | Delete
* @param {wp.media.model.Attachments} The attachments collection to observe.
[388] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[389] Fix | Delete
*/
[390] Fix | Delete
observe: function( attachments ) {
[391] Fix | Delete
this.observers = this.observers || [];
[392] Fix | Delete
this.observers.push( attachments );
[393] Fix | Delete
[394] Fix | Delete
attachments.on( 'add change remove', this._validateHandler, this );
[395] Fix | Delete
attachments.on( 'add', this._addToTotalAttachments, this );
[396] Fix | Delete
attachments.on( 'remove', this._removeFromTotalAttachments, this );
[397] Fix | Delete
attachments.on( 'reset', this._validateAllHandler, this );
[398] Fix | Delete
this.validateAll( attachments );
[399] Fix | Delete
return this;
[400] Fix | Delete
},
[401] Fix | Delete
/**
[402] Fix | Delete
* Stop replicating collection change events from another attachments collection.
[403] Fix | Delete
*
[404] Fix | Delete
* @param {wp.media.model.Attachments} The attachments collection to stop observing.
[405] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[406] Fix | Delete
*/
[407] Fix | Delete
unobserve: function( attachments ) {
[408] Fix | Delete
if ( attachments ) {
[409] Fix | Delete
attachments.off( null, null, this );
[410] Fix | Delete
this.observers = _.without( this.observers, attachments );
[411] Fix | Delete
[412] Fix | Delete
} else {
[413] Fix | Delete
_.each( this.observers, function( attachments ) {
[414] Fix | Delete
attachments.off( null, null, this );
[415] Fix | Delete
}, this );
[416] Fix | Delete
delete this.observers;
[417] Fix | Delete
}
[418] Fix | Delete
[419] Fix | Delete
return this;
[420] Fix | Delete
},
[421] Fix | Delete
/**
[422] Fix | Delete
* Update total attachment count when items are added to a collection.
[423] Fix | Delete
*
[424] Fix | Delete
* @access private
[425] Fix | Delete
*
[426] Fix | Delete
* @since 5.8.0
[427] Fix | Delete
*/
[428] Fix | Delete
_removeFromTotalAttachments: function() {
[429] Fix | Delete
if ( this.mirroring ) {
[430] Fix | Delete
this.mirroring.totalAttachments = this.mirroring.totalAttachments - 1;
[431] Fix | Delete
}
[432] Fix | Delete
},
[433] Fix | Delete
/**
[434] Fix | Delete
* Update total attachment count when items are added to a collection.
[435] Fix | Delete
*
[436] Fix | Delete
* @access private
[437] Fix | Delete
*
[438] Fix | Delete
* @since 5.8.0
[439] Fix | Delete
*/
[440] Fix | Delete
_addToTotalAttachments: function() {
[441] Fix | Delete
if ( this.mirroring ) {
[442] Fix | Delete
this.mirroring.totalAttachments = this.mirroring.totalAttachments + 1;
[443] Fix | Delete
}
[444] Fix | Delete
},
[445] Fix | Delete
/**
[446] Fix | Delete
* @access private
[447] Fix | Delete
*
[448] Fix | Delete
* @param {wp.media.model.Attachments} attachment
[449] Fix | Delete
* @param {wp.media.model.Attachments} attachments
[450] Fix | Delete
* @param {Object} options
[451] Fix | Delete
*
[452] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[453] Fix | Delete
*/
[454] Fix | Delete
_validateHandler: function( attachment, attachments, options ) {
[455] Fix | Delete
// If we're not mirroring this `attachments` collection,
[456] Fix | Delete
// only retain the `silent` option.
[457] Fix | Delete
options = attachments === this.mirroring ? options : {
[458] Fix | Delete
silent: options && options.silent
[459] Fix | Delete
};
[460] Fix | Delete
[461] Fix | Delete
return this.validate( attachment, options );
[462] Fix | Delete
},
[463] Fix | Delete
/**
[464] Fix | Delete
* @access private
[465] Fix | Delete
*
[466] Fix | Delete
* @param {wp.media.model.Attachments} attachments
[467] Fix | Delete
* @param {Object} options
[468] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[469] Fix | Delete
*/
[470] Fix | Delete
_validateAllHandler: function( attachments, options ) {
[471] Fix | Delete
return this.validateAll( attachments, options );
[472] Fix | Delete
},
[473] Fix | Delete
/**
[474] Fix | Delete
* Start mirroring another attachments collection, clearing out any models already
[475] Fix | Delete
* in the collection.
[476] Fix | Delete
*
[477] Fix | Delete
* @param {wp.media.model.Attachments} The attachments collection to mirror.
[478] Fix | Delete
* @return {wp.media.model.Attachments} Returns itself to allow chaining.
[479] Fix | Delete
*/
[480] Fix | Delete
mirror: function( attachments ) {
[481] Fix | Delete
if ( this.mirroring && this.mirroring === attachments ) {
[482] Fix | Delete
return this;
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
this.unmirror();
[486] Fix | Delete
this.mirroring = attachments;
[487] Fix | Delete
[488] Fix | Delete
// Clear the collection silently. A `reset` event will be fired
[489] Fix | Delete
// when `observe()` calls `validateAll()`.
[490] Fix | Delete
this.reset( [], { silent: true } );
[491] Fix | Delete
this.observe( attachments );
[492] Fix | Delete
[493] Fix | Delete
// Used for the search results.
[494] Fix | Delete
this.trigger( 'attachments:received', this );
[495] Fix | Delete
return this;
[496] Fix | Delete
},
[497] Fix | Delete
/**
[498] Fix | Delete
* Stop mirroring another attachments collection.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function