aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-13 06:10:43 -0500
committerjeresig <jeresig@gmail.com>2010-02-13 06:10:43 -0500
commitda966573c3f3cb083c48cd3ead88e7542937d4df (patch)
treef570d6a9a36ff663c837c4b9119e511b8b58d185 /src/manipulation.js
parent6a82f2ae63263ed9deaff9d9dcc775a2c0cde343 (diff)
downloadjquery-da966573c3f3cb083c48cd3ead88e7542937d4df.tar.gz
jquery-da966573c3f3cb083c48cd3ead88e7542937d4df.zip
Make sure that elements that have been removed also have their special events cleaned up. Fixes #6084.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index a58e52b6a..4e7a31ed4 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -547,7 +547,7 @@ jQuery.extend({
},
cleanData: function( elems ) {
- var data, id, cache = jQuery.cache;
+ var data, id, cache = jQuery.cache, special = jQuery.event.special;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
id = elem[ jQuery.expando ];
@@ -556,8 +556,13 @@ jQuery.extend({
data = cache[ id ];
if ( data.events ) {
- for ( var event in data.events ) {
- removeEvent( elem, event, data.handle );
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ } else {
+ removeEvent( elem, type, data.handle );
+ }
}
}