Changeset 20034
- Timestamp:
- 02/29/2012 06:18:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/customize-base.dev.js
r19995 r20034 281 281 }; 282 282 283 sync = {284 'val': {285 update: function() {286 this.element[ this._updater ]( this._value );287 },288 refresh: function() {289 this.set( this.element[ this._refresher ]() );290 }291 }292 }293 294 283 api.Element = api.Value.extend({ 295 284 initialize: function( element, options ) { 296 var synchronizer = api.Element.synchronizer.html, 297 type; 285 var self = this, 286 synchronizer = api.Element.synchronizer.html, 287 type, update, refresh; 298 288 299 289 this.element = api.ensure( element ); … … 316 306 this._value = this.get(); 317 307 308 update = this.update; 309 refresh = this.refresh; 310 311 this.update = function( to ) { 312 if ( to !== refresh.call( self ) ) 313 update.apply( this, arguments ); 314 }; 315 this.refresh = function() { 316 self.set( refresh.call( self ) ); 317 }; 318 318 319 this.bind( this.update ); 319 320 this.refresh = $.proxy( this.refresh, this );321 320 this.element.bind( this.events, this.refresh ); 322 321 }, … … 338 337 }, 339 338 refresh: function() { 340 this.set( this.element[ method ]());339 return this.element[ method ](); 341 340 } 342 341 }; … … 348 347 }, 349 348 refresh: function() { 350 this.set( this.element.prop( 'checked' ));349 return this.element.prop( 'checked' ); 351 350 } 352 351 }; … … 359 358 }, 360 359 refresh: function() { 361 this.set( this.element.filter( ':checked' ).val());360 return this.element.filter( ':checked' ).val(); 362 361 } 363 362 };
Note: See TracChangeset
for help on using the changeset viewer.