Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/bower_components/jquery/src/wrap.js')
-rw-r--r--libs/bower_components/jquery/src/wrap.js54
1 files changed, 29 insertions, 25 deletions
diff --git a/libs/bower_components/jquery/src/wrap.js b/libs/bower_components/jquery/src/wrap.js
index a3c35d9f24..4d2c3b2044 100644
--- a/libs/bower_components/jquery/src/wrap.js
+++ b/libs/bower_components/jquery/src/wrap.js
@@ -1,34 +1,38 @@
-define([
+define( [
"./core",
"./core/init",
+ "./manipulation", // clone
"./traversing" // parent, contents
], function( jQuery ) {
-jQuery.fn.extend({
+jQuery.fn.extend( {
wrapAll: function( html ) {
+ var wrap;
+
if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
+ return this.each( function( i ) {
+ jQuery( this ).wrapAll( html.call( this, i ) );
+ } );
}
- if ( 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() {
+ wrap.map( function() {
var elem = this;
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
+ while ( elem.firstElementChild ) {
+ elem = elem.firstElementChild;
}
return elem;
- }).append( this );
+ } ).append( this );
}
return this;
@@ -36,12 +40,12 @@ jQuery.fn.extend({
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
+ return this.each( function( i ) {
+ jQuery( this ).wrapInner( html.call( this, i ) );
+ } );
}
- return this.each(function() {
+ return this.each( function() {
var self = jQuery( this ),
contents = self.contents();
@@ -51,25 +55,25 @@ jQuery.fn.extend({
} 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 );
- });
+ return this.each( function( i ) {
+ jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
+ } );
},
unwrap: function() {
- return this.parent().each(function() {
+ return this.parent().each( function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
- }).end();
+ } ).end();
}
-});
+} );
return jQuery;
-});
+} );