Skip to content
Permalink
Browse files

Make sure namespaces is always an array, when passed to the remove sp…

…ecial. Follow-up to eed69ec.
  • Loading branch information
jeresig committed Jan 28, 2010
1 parent eed69ec commit e9092e995424828c455952e09b9ec83577009796
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/event.js
@@ -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 ) {

0 comments on commit e9092e9

Please sign in to comment.
You can’t perform that action at this time.