aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-04-25 16:08:38 +0200
committerjaubourg <j@ubourg.net>2012-04-25 16:08:38 +0200
commit245f5a244e024cb99ac84be86f86b88654a909c9 (patch)
treeb1f3412b6ccd6eaf315e7ad7bbc9df2c00261ea6 /src/callbacks.js
parent97210d4e700aba1b67ac3652303bb685d129aced (diff)
downloadjquery-245f5a244e024cb99ac84be86f86b88654a909c9.tar.gz
jquery-245f5a244e024cb99ac84be86f86b88654a909c9.zip
Regression: makes sure that all instances of a callback are removed. Unit test added.
Diffstat (limited to 'src/callbacks.js')
-rw-r--r--src/callbacks.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/callbacks.js b/src/callbacks.js
index a6c504c79..bf51ad549 100644
--- a/src/callbacks.js
+++ b/src/callbacks.js
@@ -119,8 +119,8 @@ jQuery.Callbacks = function( options ) {
// Remove a callback from the list
remove: function() {
if ( list ) {
- jQuery.each( arguments, function( index, arg ) {
- if ( ( index = jQuery.inArray( arg, list ) ) > -1 ) {
+ jQuery.each( arguments, function( _, arg, index ) {
+ while( ( index = jQuery.inArray( arg, list, index || 0 ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {