aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2012-12-20 03:52:08 +0400
committerDave Methvin <dave.methvin@gmail.com>2012-12-20 20:55:30 -0500
commit5afc93c436020f8ceabe8cab449f1c0030ba6ecd (patch)
treec1227810452cb5a1771d79dec20207a5869bade6 /src
parent96a349e46d61ee05e576b8544051e375094c0b4d (diff)
downloadjquery-5afc93c436020f8ceabe8cab449f1c0030ba6ecd.tar.gz
jquery-5afc93c436020f8ceabe8cab449f1c0030ba6ecd.zip
Fix #13094. Pass index to .before(fn) fn as documented. Close gh-1093.
Diffstat (limited to 'src')
-rw-r--r--src/manipulation.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 062527708..5fec948cb 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -286,16 +286,17 @@ jQuery.fn.extend({
var fragment, first, scripts, hasScripts, node, doc,
i = 0,
l = this.length,
+ set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
- return this.each(function() {
- var self = jQuery( this );
+ return this.each(function( index ) {
+ var self = set.eq( index );
if ( isFunction ) {
- args[0] = value.call( this, i, table ? self.html() : undefined );
+ args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});