Commit 42dbc865 authored by jaubourg's avatar jaubourg

Use real declaration since that helps gzip: thanks @gibson042.

parent 245f5a24
...@@ -93,7 +93,8 @@ jQuery.Callbacks = function( options ) { ...@@ -93,7 +93,8 @@ jQuery.Callbacks = function( options ) {
// First, we save the current length // First, we save the current length
var start = list.length; var start = list.length;
(function add( args ) { (function add( args ) {
jQuery.each( args, function( type, arg ) { jQuery.each( args, function( _, arg ) {
var type;
if ( ( type = jQuery.type(arg) ) === "array" ) { if ( ( type = jQuery.type(arg) ) === "array" ) {
// Inspect recursively // Inspect recursively
add( arg ); add( arg );
...@@ -119,8 +120,9 @@ jQuery.Callbacks = function( options ) { ...@@ -119,8 +120,9 @@ jQuery.Callbacks = function( options ) {
// Remove a callback from the list // Remove a callback from the list
remove: function() { remove: function() {
if ( list ) { if ( list ) {
jQuery.each( arguments, function( _, arg, index ) { jQuery.each( arguments, function( _, arg ) {
while( ( index = jQuery.inArray( arg, list, index || 0 ) ) > -1 ) { var index = 0;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 ); list.splice( index, 1 );
// Handle firing indexes // Handle firing indexes
if ( firing ) { if ( firing ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment