Theme Customizer: Make the wp.customize.Events methods chainable. see #19910.

git-svn-id: http://core.svn.wordpress.org/trunk@20801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2012-05-16 05:17:26 +00:00
parent a13f5e45ba
commit a2eb607264
1 changed files with 3 additions and 0 deletions

View File

@ -127,17 +127,20 @@ if ( typeof wp === 'undefined' )
trigger: function( id ) {
if ( this.topics && this.topics[ id ] )
this.topics[ id ].fireWith( this, slice.call( arguments, 1 ) );
return this;
},
bind: function( id, callback ) {
this.topics = this.topics || {};
this.topics[ id ] = this.topics[ id ] || $.Callbacks();
this.topics[ id ].add.apply( this.topics[ id ], slice.call( arguments, 1 ) );
return this;
},
unbind: function( id, callback ) {
if ( this.topics && this.topics[ id ] )
this.topics[ id ].remove.apply( this.topics[ id ], slice.call( arguments, 1 ) );
return this;
}
};