aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-02-11 01:42:51 -0500
committerJohn Resig <jeresig@gmail.com>2010-02-11 01:42:51 -0500
commit021b809acecc4e94613375b3182c86722470fe9b (patch)
tree77b70e014be92b036401945d08cf35aeec3eeee1 /src
parent639f4931b0409a8eb83aaf89a03b6b52f674663e (diff)
downloadjquery-021b809acecc4e94613375b3182c86722470fe9b.tar.gz
jquery-021b809acecc4e94613375b3182c86722470fe9b.zip
Make sure that the teardown is called after all the handlers of a type are removed. Fixes #6065.
Diffstat (limited to 'src')
-rw-r--r--src/event.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event.js b/src/event.js
index 2e510eabf..e15a2ea63 100644
--- a/src/event.js
+++ b/src/event.js
@@ -221,7 +221,7 @@ jQuery.event = {
}
// remove generic event handler if no more handlers exist
- if ( jQuery.isEmptyObject( events[ type ] ) ) {
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
removeEvent( elem, type, elemData.handle );
}