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:
parent
a13f5e45ba
commit
a2eb607264
|
@ -127,17 +127,20 @@ if ( typeof wp === 'undefined' )
|
||||||
trigger: function( id ) {
|
trigger: function( id ) {
|
||||||
if ( this.topics && this.topics[ id ] )
|
if ( this.topics && this.topics[ id ] )
|
||||||
this.topics[ id ].fireWith( this, slice.call( arguments, 1 ) );
|
this.topics[ id ].fireWith( this, slice.call( arguments, 1 ) );
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
bind: function( id, callback ) {
|
bind: function( id, callback ) {
|
||||||
this.topics = this.topics || {};
|
this.topics = this.topics || {};
|
||||||
this.topics[ id ] = this.topics[ id ] || $.Callbacks();
|
this.topics[ id ] = this.topics[ id ] || $.Callbacks();
|
||||||
this.topics[ id ].add.apply( this.topics[ id ], slice.call( arguments, 1 ) );
|
this.topics[ id ].add.apply( this.topics[ id ], slice.call( arguments, 1 ) );
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
unbind: function( id, callback ) {
|
unbind: function( id, callback ) {
|
||||||
if ( this.topics && this.topics[ id ] )
|
if ( this.topics && this.topics[ id ] )
|
||||||
this.topics[ id ].remove.apply( this.topics[ id ], slice.call( arguments, 1 ) );
|
this.topics[ id ].remove.apply( this.topics[ id ], slice.call( arguments, 1 ) );
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue