diff options
author | seshukm <seshu.kumar.m@huawei.com> | 2017-03-06 10:23:16 +0530 |
---|---|---|
committer | seshukm <seshu.kumar.m@huawei.com> | 2017-03-06 10:23:16 +0530 |
commit | 663394f188c4460ad889b70a82557db0f9754032 (patch) | |
tree | 09d5bea2b0684b5752f5cd8f74e1f3f4ffaa740a /vnfmarket/common/thirdparty/jquery/src/wrap.js | |
parent | 194d6e19da729265130123b6638e0f57589c9367 (diff) |
thirdparty files updated for the vnf market place
IssueId : CLIENT-4
Change-Id: Id58c2d11985bda35dc482b122dc404aea2e477da
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'vnfmarket/common/thirdparty/jquery/src/wrap.js')
-rw-r--r-- | vnfmarket/common/thirdparty/jquery/src/wrap.js | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/vnfmarket/common/thirdparty/jquery/src/wrap.js b/vnfmarket/common/thirdparty/jquery/src/wrap.js new file mode 100644 index 00000000..88b9bb56 --- /dev/null +++ b/vnfmarket/common/thirdparty/jquery/src/wrap.js @@ -0,0 +1,77 @@ +define( [ + "./core", + "./core/init", + "./manipulation", // clone + "./traversing" // parent, contents +], function( jQuery ) { + +"use strict"; + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( jQuery.isFunction( html ) ) { + html = html.call( 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( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + +return jQuery; +} ); |