aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorMORGAN <morgan@morgangraphics.com>2012-10-16 10:25:08 -0400
committerRick Waldron <waldron.rick@gmail.com>2012-10-16 10:25:08 -0400
commit4bb46f413a0e2f6933013b26d2aceddca6cf03f1 (patch)
tree1697b5a76869cd7d29111573a787bdaebbb81a8e /src/traversing.js
parented9e34482a303e7e64c397f89533dbe64f51cfbf (diff)
downloadjquery-4bb46f413a0e2f6933013b26d2aceddca6cf03f1.tar.gz
jquery-4bb46f413a0e2f6933013b26d2aceddca6cf03f1.zip
Return correct index for no-arg index() calls. Fixes #10977. Closes gh-971
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/traversing.js b/src/traversing.js
index 4c58ae0b8..d92bec4cb 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -112,7 +112,7 @@ jQuery.fn.extend({
// No argument, return index in parent
if ( !elem ) {
- return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
}
// index in selector