diff options
author | jeresig <jeresig@gmail.com> | 2010-01-28 14:16:52 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-01-28 14:16:52 -0500 |
commit | e9092e995424828c455952e09b9ec83577009796 (patch) | |
tree | 39876b985c74d0d28b5958434c97241f1b81e2cc /src/event.js | |
parent | eed69eccc54d010889b5d8495320538d7ceb4e51 (diff) | |
download | jquery-e9092e995424828c455952e09b9ec83577009796.tar.gz jquery-e9092e995424828c455952e09b9ec83577009796.zip |
Make sure namespaces is always an array, when passed to the remove special. Follow-up to eed69eccc54d010889b5d8495320538d7ceb4e51.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js index 2978bc6a5..53ef72c0c 100644 --- a/src/event.js +++ b/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 ) { |