Shortens slice expression in channel helpers as per rwaldron's suggestion.
This commit is contained in:
parent
57634a2c15
commit
1f084d024d
1 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,8 @@
|
||||||
publish: "fire",
|
publish: "fire",
|
||||||
subscribe: "add",
|
subscribe: "add",
|
||||||
unsubscribe: "remove"
|
unsubscribe: "remove"
|
||||||
};
|
},
|
||||||
|
sliceChannel = [].slice;
|
||||||
|
|
||||||
jQuery.Channel = function( name ) {
|
jQuery.Channel = function( name ) {
|
||||||
var callbacks,
|
var callbacks,
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
jQuery.each( channelMethods, function( method ) {
|
jQuery.each( channelMethods, function( method ) {
|
||||||
jQuery[ method ] = function( name ) {
|
jQuery[ method ] = function( name ) {
|
||||||
var channel = jQuery.Channel( name );
|
var channel = jQuery.Channel( name );
|
||||||
channel[ method ].apply( channel, Array.prototype.slice.call( arguments, 1 ) );
|
channel[ method ].apply( channel, sliceChannel.call( arguments, 1 ) );
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue