diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2013-04-08 23:40:08 +0200 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-04-17 23:06:33 -0400 |
commit | 0db70aa1fa084ccf1ef90d9b78382df95bdf9c85 (patch) | |
tree | 6588d1e0f43d977fb7cf0eabda9260d1b9231586 /src/manipulation.js | |
parent | 12a101729086ec1f9b8b029cd66971c11959bc33 (diff) | |
download | jquery-0db70aa1fa084ccf1ef90d9b78382df95bdf9c85.tar.gz jquery-0db70aa1fa084ccf1ef90d9b78382df95bdf9c85.zip |
Fix #13741. Make wrap/unwrap methods optional; close gh-1236.
move size() test to unit/deprecated;
don't use size() in other tests;
make 2 unit tests actually fire;
code cleanup
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 938fb0c3a..585d261e5 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -60,71 +60,6 @@ jQuery.fn.extend({ }, null, value, arguments.length ); }, - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, - append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { |