scratch – Diff between revs 58 and 125
?pathlinks?
Rev 58 | Rev 125 | |||
---|---|---|---|---|
Line 3... | Line 3... | |||
3 | "./core/init", |
3 | "./core/init", |
|
4 | "./manipulation", // clone |
4 | "./manipulation", // clone |
|
5 | "./traversing" // parent, contents |
5 | "./traversing" // parent, contents |
|
6 | ], function( jQuery ) { |
6 | ], function( jQuery ) { |
|
Line 7... | Line -... | |||
7 | |
- | ||
8 | "use strict"; |
- | ||
9 | |
7 | |
|
10 | jQuery.fn.extend( { |
8 | jQuery.fn.extend({ |
|
11 | wrapAll: function( html ) { |
9 | wrapAll: function( html ) { |
|
Line 12... | Line -... | |||
12 | var wrap; |
- | ||
13 | |
10 | var wrap; |
|
- | 11 | |
||
14 | if ( this[ 0 ] ) { |
12 | if ( jQuery.isFunction( html ) ) { |
|
- | 13 | return this.each(function( i ) { |
||
15 | if ( jQuery.isFunction( html ) ) { |
14 | jQuery( this ).wrapAll( html.call(this, i) ); |
|
Line -... | Line 15... | |||
- | 15 | }); |
||
- | 16 | } |
||
16 | html = html.call( this[ 0 ] ); |
17 | |
|
17 | } |
18 | if ( this[ 0 ] ) { |
|
Line 18... | Line 19... | |||
18 | |
19 | |
|
19 | // The elements to wrap the target around |
20 | // The elements to wrap the target around |
|
Line 63... | Line 64... | |||
63 | return this.each( function( i ) { |
64 | return this.each(function( i ) { |
|
64 | jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); |
65 | jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); |
|
65 | } ); |
66 | }); |
|
66 | }, |
67 | }, |
|
Line 67... | Line 68... | |||
67 | |
68 | |
|
68 | unwrap: function( selector ) { |
69 | unwrap: function() { |
|
- | 70 | return this.parent().each(function() { |
||
69 | this.parent( selector ).not( "body" ).each( function() { |
71 | if ( !jQuery.nodeName( this, "body" ) ) { |
|
70 | jQuery( this ).replaceWith( this.childNodes ); |
72 | jQuery( this ).replaceWith( this.childNodes ); |
|
71 | } ); |
73 | } |
|
72 | return this; |
74 | }).end(); |
|
73 | } |
75 | } |
|
Line 74... | Line 76... | |||
74 | } ); |
76 | }); |
|
75 | |
77 | |