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

git-svn-id: https://develop.svn.wordpress.org/trunk@20801 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-05-16 05:17:26 +00:00
parent 45919db511
commit 47d5d564b4
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;
}
};