X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=7128d11cfb46a82d1b78999a0d6d1476332ad695;hb=ebad701751689b773afe29d1e3c4532c7810d02a;hp=2a6b9dc3009064efa1e995bfe117690158bad5e2;hpb=b30af34f28074b491929445f5aad3d62c63e772f;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 2a6b9dc..7128d11 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -168,21 +168,8 @@ jQuery.fn.extend({ // Copy the events from the original to the clone if ( events === true ) { - var orig = this.find("*").andSelf(), i = 0; - - ret.find("*").andSelf().each(function(){ - if ( this.nodeName !== orig[i].nodeName ) { return; } - - var events = jQuery.data( orig[i], "events" ); - - for ( var type in events ) { - for ( var handler in events[ type ] ) { - jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); - } - } - - i++; - }); + cloneCopyEvent( this, ret ); + cloneCopyEvent( this.find("*"), ret.find("*") ); } // Return the cloned set @@ -197,7 +184,7 @@ jQuery.fn.extend({ // See if we can take a shortcut and just use innerHTML } else if ( typeof value === "string" && !/