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

2.0.4 Live @index still not working correctly #640

Closed
AdamTourkow opened this issue Jan 3, 2014 · 7 comments · Fixed by #643
Closed

2.0.4 Live @index still not working correctly #640

AdamTourkow opened this issue Jan 3, 2014 · 7 comments · Fixed by #643
Assignees
Labels
Milestone

Comments

@AdamTourkow
Copy link

There was a pending fix to live binding in commit:
cb849f3

While waiting for the fix to reach release I hand modified the changes into my js which worked:
http://subsonic-systems.com/misc/can.custom_modifed_by_me.js
Modifed 2.0.3 code: http://jsfiddle.net/subsonic/6v6nz/

When using the 2.0.4 code, it still doesn't work.
Current 2.0.4 code: http://jsfiddle.net/subsonic/j9ZBw/

Steps to reproduce:

Expected:
When deleting first element/node index should be deleted correctly.

@justinbmeyer
Copy link
Contributor

By "it" you mean some other case than the one tested in cb849f3 ?

@justinbmeyer
Copy link
Contributor

This seems to be related to using partials:

http://jsfiddle.net/j9ZBw/5/

@AdamTourkow
Copy link
Author

By "it", I mean: "Index: 0 Parent: | Item 0"

That one doesn't delete, and then all the indexes above it decrement.

Not to mention, it worked when I just applied that one patch as can be seen in http://jsfiddle.net/subsonic/6v6nz/

@ghost ghost assigned justinbmeyer Jan 6, 2014
@justinbmeyer
Copy link
Contributor

@AdamTourkow After looking at this fiddle for a bit, I hope this is just an example and your code does not work like this. Items should not be capitalized, plus it's a map.

@justinbmeyer
Copy link
Contributor

Here's a minimal breaking example: http://jsfiddle.net/j9ZBw/7/

@justinbmeyer
Copy link
Contributor

It seems there is a difference between how the partial is found. http://jsfiddle.net/j9ZBw/9/ breaks, but if you change:

{{>anitem}}

to

{{>itempartial}}

It works. My bet is that this is due to a bug with renderer functions not actually being renderer functions.

@justinbmeyer
Copy link
Contributor

Nope, seems to be due to to reading a partial in can.view.render.txt being "compute-itized" ....

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

Successfully merging a pull request may close this issue.

2 participants