Ticket #53171: 53171.4.diff
| File 53171.4.diff, 1.4 KB (added by , 5 years ago) |
|---|
-
src/js/media/models/attachments.js
212 212 this.observers.push( attachments ); 213 213 214 214 attachments.on( 'add change remove', this._validateHandler, this ); 215 attachments.on( 'add', this._addToTotalAttachments, this ); 216 attachments.on( 'remove', this._removeFromTotalAttachments, this ); 215 217 attachments.on( 'reset', this._validateAllHandler, this ); 216 218 this.validateAll( attachments ); 217 219 return this; … … 237 239 return this; 238 240 }, 239 241 /** 242 * Update total attachment count when items are added to a collection. 243 * 240 244 * @access private 241 245 * 246 * @since 5.8.0 247 */ 248 _removeFromTotalAttachments: function() { 249 if ( this.mirroring ) { 250 this.mirroring.totalAttachments = this.mirroring.totalAttachments - 1; 251 } 252 }, 253 /** 254 * Update total attachment count when items are added to a collection. 255 * 256 * @access private 257 * 258 * @since 5.8.0 259 */ 260 _addToTotalAttachments: function() { 261 if ( this.mirroring ) { 262 this.mirroring.totalAttachments = this.mirroring.totalAttachments + 1; 263 } 264 }, 265 /** 266 * @access private 267 * 242 268 * @param {wp.media.model.Attachments} attachment 243 269 * @param {wp.media.model.Attachments} attachments 244 270 * @param {Object} options