X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=c23f62ed19c732a3d7e411ff18822e70dadb7510;hb=faefbb1ad0b81e8001b582d06d5bd9c9236e62ce;hp=7dea3493c2947f305963c9b79fe3ccd2b34f40c8;hpb=291b1edf444f30d9360a42c8d563e26eaf1a2ddb;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 7dea349..c23f62e 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -373,12 +373,12 @@ function cloneCopyEvent(orig, ret) { var i = 0; ret.each(function() { - if ( this.nodeType !== 1 || this.nodeName !== (orig[i] && orig[i].nodeName) ) { + if ( this.nodeType !== 1 || this.nodeName !== (orig[i] && orig[i].nodeName) || !jQuery.hasData(orig[i]) ) { return; } var oldData = jQuery.data( orig[i++] ), - curData = jQuery.data( this, oldData ), + curData = jQuery.data( this, jQuery.extend(true, {}, oldData) ), events = oldData && oldData.events; if ( events ) {