Skip to content

updating Understand-index.md #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

updating Understand-index.md #420

wants to merge 2 commits into from

Conversation

a14m
Copy link

@a14m a14m commented Sep 14, 2013

as of version 1.9.1 the index uses the .first method instead of .last
check the code in the .min.js attached index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1}

…changed than 1.9.1

as of version 1.10.2 the index uses the .first method instead of .last
check the code in the .min.js attached `index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1}`
@a14m
Copy link
Author

a14m commented Sep 15, 2013

i just checked and found out that this was change in versions even prior to 1.9.1 as the code for index is

        index: function(e) {
            return e ? "string" == typeof e ? b.inArray(this[0], b(e)) : b.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
        },

you can verify the code responsible for this behaviour change in any version > 1.9.0b1
i attached the code sample here

```
index: function(e) {
            return e ? "string" == typeof e ? b.inArray(this[0], b(e)) : b.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
        },
```
@a14m a14m closed this Sep 15, 2013
@a14m
Copy link
Author

a14m commented Sep 15, 2013

closed this pull request cause it have 2 commits and the first was mistakenly added so it's my bad... added another cleaner pull requers #424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant