X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=dbf86a7b3aff9d30576de8cd1e6888a644e174fb;hb=6a85898d131f9921f2d8e885a892fbdcf4d9c5c6;hp=f577cf83772928522e2c42e70ccff2114d788207;hpb=f57d93bf18a2d5c3b7a0b50da67cf6147aa389c3;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index f577cf8..dbf86a7 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -9,7 +9,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, return rselfClosing.test(tag) ? all : front + ">"; - }); + }; jQuery.fn.extend({ text: function( text ) { @@ -37,7 +37,7 @@ jQuery.fn.extend({ jQuery(this).wrapAll( html.apply(this, arguments) ); }); } - + if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(); @@ -161,6 +161,10 @@ jQuery.fn.extend({ return this.after( value ).remove(); }, + detach: function( selector ) { + return this.remove( selector, true ); + }, + domManip: function( args, table, callback ) { var fragment, scripts, cacheable, cached, cacheresults, first, value = args[0]; @@ -183,7 +187,7 @@ jQuery.fn.extend({ cached = true; } } - + if ( !fragment ) { fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(); scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ); @@ -249,14 +253,15 @@ jQuery.each({ }); jQuery.each({ - remove: function( selector ) { + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) { - if ( this.nodeType === 1 ) { + if ( !keepData && this.nodeType === 1 ) { cleanData( jQuery("*", this).add(this) ); } if ( this.parentNode ) { - this.parentNode.removeChild( this ); + this.parentNode.removeChild( this ); } } },