diff options
-rw-r--r-- | src/manipulation.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 5109cf093..27bc0b46b 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -283,7 +283,18 @@ function cloneCopyEvent(orig, ret) { 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 ); + } + } + } }); } |