Changeset 20799
- Timestamp:
- 05/15/2012 10:43:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/customize-base.dev.js
r20798 r20799 284 284 285 285 this._value[ id ] = value; 286 this._value[ id ].parent = this; 286 value.parent = this; 287 if ( value.extended( api.Value ) ) 288 value.bind( this._change ); 289 290 this.trigger( 'add', value ); 287 291 288 292 if ( this._deferreds[ id ] ) … … 306 310 307 311 remove: function( id ) { 312 var value; 313 314 if ( this.has( id ) ) { 315 value = this.value( id ); 316 this.trigger( 'remove', value ); 317 if ( value.extended( api.Value ) ) 318 value.unbind( this._change ); 319 delete value.parent; 320 } 321 308 322 delete this._value[ id ]; 309 323 delete this._deferreds[ id ]; … … 353 367 354 368 return dfd.promise(); 369 }, 370 371 _change: function() { 372 this.parent.trigger( 'change', this ); 355 373 } 356 374 }); 375 376 $.extend( api.Values.prototype, api.Events ); 357 377 358 378 /* =====================================================================
Note: See TracChangeset
for help on using the changeset viewer.