Permalink
Browse files

re-intigrated changes from John Resig http://dev.jquery.com/changeset…

  • Loading branch information...
1 parent f2b8d82 commit 72bda523ad40af0889a859c0f41f7a88c1a14d93 @cowboy committed Sep 30, 2009
Showing with 4 additions and 8 deletions.
  1. +4 −8 jquery.ba-unwrap.js
View
@@ -1,5 +1,5 @@
/*!
- * unwrap - v0.1 - 7/18/2009
+ * unwrap - v0.2 - 9/30/2009
* http://benalman.com/projects/jquery-unwrap-plugin/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
@@ -8,11 +8,7 @@
*/
jQuery.fn.unwrap = function() {
- this.parent().not(document.body)
- .each(function(){
- jQuery(this).replaceWith( this.childNodes );
- });
-
- return this;
+ return this.parent().each(function( n, elem ){
+ jQuery.nodeName( elem, 'body' ) || jQuery( elem ).replaceWith( elem.childNodes );
+ }).end();
};
-

0 comments on commit 72bda52

Please sign in to comment.