X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=2af2d7e7dc80598794e2d7d2b72b3a82d9b914bb;hb=6cf981eea20695987b4f7341f80442a7cf8271eb;hp=5109cf093b7e916e16bcc2883ca3b1e64653b288;hpb=3776cbe314ac6f5081e998c3d5ac84d3fbc51872;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 5109cf0..2af2d7e 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 && 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 ); + } + } + } }); }