From bb60d2fc7c06ec661e4c66ac8778e1f2070103cd Mon Sep 17 00:00:00 2001 From: "Eran (ev672n), Vosk" Date: Mon, 29 Oct 2018 18:38:10 +0200 Subject: Sync code Sync the code between repositories Change-Id: Ic431c58c68716b6d401954fb854a183e0d222f57 Issue-ID: SDC-1874 Signed-off-by: Eran (ev672n), Vosk --- app/bower_components/jquery/src/wrap.js | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 app/bower_components/jquery/src/wrap.js (limited to 'app/bower_components/jquery/src/wrap.js') diff --git a/app/bower_components/jquery/src/wrap.js b/app/bower_components/jquery/src/wrap.js new file mode 100644 index 0000000..4d2c3b2 --- /dev/null +++ b/app/bower_components/jquery/src/wrap.js @@ -0,0 +1,79 @@ +define( [ + "./core", + "./core/init", + "./manipulation", // clone + "./traversing" // parent, contents +], function( jQuery ) { + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + 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 + 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.firstElementChild ) { + elem = elem.firstElementChild; + } + + 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(); + } +} ); + +return jQuery; +} ); -- cgit 1.2.3-korg