mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 16:24:57 -05:00
18
src/wrap.js
18
src/wrap.js
@@ -7,18 +7,18 @@ define([
|
||||
|
||||
jQuery.fn.extend({
|
||||
wrapAll: function( html ) {
|
||||
if ( jQuery.isFunction( html ) ) {
|
||||
return this.each(function(i) {
|
||||
jQuery(this).wrapAll( html.call(this, i) );
|
||||
});
|
||||
}
|
||||
var wrap;
|
||||
|
||||
if ( this[ 0 ] ) {
|
||||
if ( jQuery.isFunction( html ) ) {
|
||||
html = html.call( this[ 0 ] );
|
||||
}
|
||||
|
||||
if ( this[0] ) {
|
||||
// The elements to wrap the target around
|
||||
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
|
||||
wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
|
||||
|
||||
if ( this[0].parentNode ) {
|
||||
wrap.insertBefore( this[0] );
|
||||
if ( this[ 0 ].parentNode ) {
|
||||
wrap.insertBefore( this[ 0 ] );
|
||||
}
|
||||
|
||||
wrap.map(function() {
|
||||
|
||||
Reference in New Issue
Block a user