X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=1e4df48c2d18f729f8f5a146ffc9287b62d1f500;hb=4490f4285cc4cdafba67fee726d3eba4a3d81a0f;hp=442a14d2990dc978c8374232050988cb6dc2a4db;hpb=0a0cff9d29c4bd559da689d96c532d06c03fce09;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 442a14d..1e4df48 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -7,7 +7,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rtbody = /", "" ], @@ -159,7 +159,7 @@ jQuery.fn.extend({ } if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); + elem.parentNode.removeChild( elem ); } } } @@ -184,7 +184,7 @@ jQuery.fn.extend({ }, clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? true : dataAndEvents; + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { @@ -353,8 +353,8 @@ function cloneCopyEvent( src, dest ) { } var internalKey = jQuery.expando, - oldData = jQuery.data( src ), - curData = jQuery.data( dest, oldData ); + oldData = jQuery.data( src ), + curData = jQuery.data( dest, oldData ); // Switch to use the internal data object, if it exists, for the next // stage of data copying @@ -503,6 +503,8 @@ jQuery.extend({ // proprietary methods to clear the events. Thanks to MooTools // guys for this hotness. + cloneFixAttributes( elem, clone ); + // Using Sizzle here is crazy slow, so we use getElementsByTagName // instead srcElements = elem.getElementsByTagName("*"); @@ -514,8 +516,6 @@ jQuery.extend({ for ( i = 0; srcElements[i]; ++i ) { cloneFixAttributes( srcElements[i], destElements[i] ); } - - cloneFixAttributes( elem, clone ); } // Copy the events from the original to the clone @@ -537,7 +537,7 @@ jQuery.extend({ } // Return the cloned set return clone; - }, +}, clean: function( elems, context, fragment, scripts ) { context = context || document;