diff --git a/wp-includes/js/customize-base.dev.js b/wp-includes/js/customize-base.dev.js index 04fe2f2afd..cf3f168d30 100644 --- a/wp-includes/js/customize-base.dev.js +++ b/wp-includes/js/customize-base.dev.js @@ -291,43 +291,24 @@ if ( typeof wp === 'undefined' ) return this._value[ id ]; }, + create: function( id ) { + return this.add( id, new this.defaultConstructor( api.Class.applicator, slice.call( arguments, 1 ) ) ); + }, + get: function() { var result = {}; - if ( arguments.length ) - return this.pass( 'get', arguments ); - $.each( this._value, function( key, obj ) { result[ key ] = obj.get(); } ); return result; }, - set: function( id ) { - if ( this.has( id ) ) - return this.pass( 'set', arguments ); - - return this.add( id, new this.defaultConstructor( api.Class.applicator, slice.call( arguments, 1 ) ) ); - }, - remove: function( id ) { delete this._value[ id ]; delete this._deferreds[ id ]; }, - pass: function( fn, args ) { - var id, value; - - args = slice.call( args ); - id = args.shift(); - - if ( ! this.has( id ) ) - return; - - value = this.value( id ); - return value[ fn ].apply( value, args ); - }, - /** * Runs a callback once all requested values exist. * @@ -374,13 +355,6 @@ if ( typeof wp === 'undefined' ) } }); - $.each( [ 'bind', 'unbind', 'link', 'unlink', 'sync', 'unsync', 'setter', 'resetSetter' ], function( i, method ) { - api.Values.prototype[ method ] = function() { - return this.pass( method, arguments ); - }; - }); - - /* ===================================================================== * An observable value that syncs with an element. * diff --git a/wp-includes/js/customize-controls.dev.js b/wp-includes/js/customize-controls.dev.js index e6fa3bc5cd..3b1287a38d 100644 --- a/wp-includes/js/customize-controls.dev.js +++ b/wp-includes/js/customize-controls.dev.js @@ -435,7 +435,7 @@ }); $.each( api.settings.settings, function( id, data ) { - api.set( id, id, data.value, { + api.create( id, id, data.value, { transport: data.transport, previewer: previewer } ); @@ -526,7 +526,7 @@ control.element.bind( function( to ) { if ( ! to ) - last = api.get( 'header_textcolor' ); + last = api( 'header_textcolor' ).get(); control.setting.set( to ? last : 'blank' ); }); diff --git a/wp-includes/js/customize-preview.dev.js b/wp-includes/js/customize-preview.dev.js index 5aee863424..674855912d 100644 --- a/wp-includes/js/customize-preview.dev.js +++ b/wp-includes/js/customize-preview.dev.js @@ -65,11 +65,13 @@ preview = new api.Preview( window.location.href ); $.each( api.settings.values, function( id, value ) { - api.set( id, value ); + api.create( id, value ); }); preview.bind( 'setting', function( args ) { - api.set.apply( api, args ); + var value = api( args.shift() ); + if ( value ) + value.apply( value, args ); }); body = $(document.body);