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:
parent
45919db511
commit
47d5d564b4
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue