Regression: makes sure that all instances of a callback are removed. Unit test added.

This commit is contained in:
jaubourg
2012-04-25 16:08:38 +02:00
parent 97210d4e70
commit 245f5a244e
2 changed files with 17 additions and 2 deletions

View File

@@ -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 ) {