Skip to content
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

552 index calculation #553

Merged
merged 5 commits into from
Nov 25, 2013
Merged

552 index calculation #553

merged 5 commits into from
Nov 25, 2013

Conversation

retro
Copy link
Contributor

@retro retro commented Nov 17, 2013

This makes sure @index is correctly calculated for the can.List objects by using fromIndex so it doesn't always return first instance of the element in the array.

Closes #552

@@ -1894,8 +1894,10 @@ function( can ){
return can.view.lists && can.view.lists(expr, function(item, key) {
// Create a compute that listens to whenever the index of the item in our list changes.
var indexCompute = can.compute(function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A compute probably does not need to be created. A function will do I bet.

@daffl
Copy link
Contributor

daffl commented Nov 25, 2013

Can we fix this one? I would like to get it into 2.0.3.

@imjoshdean
Copy link
Contributor

@daffl Yes, just let me quick add a commit to the branch that removes the can.compute as @justinbmeyer suggested. A compute does not need to be created, as he suggested.

daffl added a commit that referenced this pull request Nov 25, 2013
@daffl daffl merged commit 75bf271 into master Nov 25, 2013
@daffl daffl deleted the 552-index-calculation branch November 25, 2013 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@index is not calculated correctly when there are identical elements in the list
4 participants