mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Make sure namespaces is always an array, when passed to the remove special. Follow-up to eed69eccc5
.
This commit is contained in:
parent
eed69eccc5
commit
e9092e9954
@ -187,6 +187,9 @@ jQuery.event = {
|
||||
|
||||
namespace = new RegExp("(^|\\.)" +
|
||||
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
|
||||
|
||||
} else {
|
||||
namespaces = [];
|
||||
}
|
||||
|
||||
var special = this.special[ type ] || {};
|
||||
@ -208,14 +211,14 @@ jQuery.event = {
|
||||
}
|
||||
|
||||
if ( special.remove ) {
|
||||
special.remove.call( elem, namespaces || [], fn);
|
||||
special.remove.call( elem, namespaces, fn);
|
||||
}
|
||||
|
||||
// remove generic event handler if no more handlers exist
|
||||
for ( ret in events[ type ] ) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !ret ) {
|
||||
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
|
||||
if ( elem.removeEventListener ) {
|
||||
|
Loading…
Reference in New Issue
Block a user