aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorToby Brain <tobyb@freshview.com>2011-11-06 16:59:41 -0500
committerDave Methvin <dave.methvin@gmail.com>2011-11-06 16:59:41 -0500
commit47c605f693457412a53c9145cafe55420ab8f236 (patch)
tree74c11c053491d3bd14d5d5701025b0bd3dc40668 /src/manipulation.js
parent90c019de5efb63b13c4ac9b29de06bac7eb9ffdc (diff)
downloadjquery-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.js6
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 );
});
},