diff options
author | Toby Brain <tobyb@freshview.com> | 2011-11-06 16:59:41 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-11-06 16:59:41 -0500 |
commit | 47c605f693457412a53c9145cafe55420ab8f236 (patch) | |
tree | 74c11c053491d3bd14d5d5701025b0bd3dc40668 /src/manipulation.js | |
parent | 90c019de5efb63b13c4ac9b29de06bac7eb9ffdc (diff) | |
download | jquery-47c605f693457412a53c9145cafe55420ab8f236.tar.gz jquery-47c605f693457412a53c9145cafe55420ab8f236.zip |
Fix #10177. Pass correct index to function-parameter of `.wrap`
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 6e77e2daa..6f0b44803 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -117,8 +117,10 @@ jQuery.fn.extend({ }, wrap: function( html ) { - return this.each(function() { - jQuery( this ).wrapAll( html ); + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, |