mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #13150, .has() w/o args checks for any callbacks. Close gh-1111.
This commit is contained in:
committed by
Dave Methvin
parent
64b55f0b79
commit
54fc5fdfa2
@@ -137,9 +137,10 @@ jQuery.Callbacks = function( options ) {
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Control if a given callback is in the list
|
||||
// Check if a given callback is in the list.
|
||||
// If no argument is given, return whether or not list has callbacks attached.
|
||||
has: function( fn ) {
|
||||
return jQuery.inArray( fn, list ) > -1;
|
||||
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
|
||||
},
|
||||
// Remove all callbacks from the list
|
||||
empty: function() {
|
||||
|
||||
Reference in New Issue
Block a user