Simplify jQuery#wrap

This commit is contained in:
Oleg 2012-12-19 22:42:07 +04:00
parent 2378438a97
commit 8c4b9f082b

View File

@ -156,15 +156,14 @@ jQuery.fn.extend({
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
for ( ; ( elem = this[ i ] ) != null; i++ ) {
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
// Remove element nodes and prevent memory leaks
jQuery.cleanData( getAll( elem, false ) );
// Remove any remaining nodes
elem.textContent = "";
}
}