git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ea539b
)
Explicitly re-bind the events on clone. Copying over the data isn't enough. Fixes...
author
jeresig
<jeresig@gmail.com>
Tue, 22 Dec 2009 17:04:17 +0000
(12:04 -0500)
committer
jeresig
<jeresig@gmail.com>
Tue, 22 Dec 2009 17:04:17 +0000
(12:04 -0500)
src/manipulation.js
patch
|
blob
|
history
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
5109cf0
..
27bc0b4
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-283,7
+283,18
@@
function cloneCopyEvent(orig, ret) {
return;
}
return;
}
- jQuery.data( this, jQuery.data( orig[i++] ) );
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
});
}
});
}