Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Fix for insertion new item before the last item #109

Merged
merged 2 commits into from
Jan 26, 2015
Merged

Fix for insertion new item before the last item #109

merged 2 commits into from
Jan 26, 2015

Conversation

alex-ionochkin
Copy link
Contributor

@sinan, can you review this fix? It's for a case when new item should be inserted before the last item in the list. Currently new item is added to the end of the list in this case

@@ -104,9 +104,9 @@ module.exports = class KDListView extends KDView
{boxed, lastToFirst} = @getOptions()


isLastIndex = index >= @items.length - 1
isLastIndex = index > @items.length - 1
Copy link
Member

Choose a reason for hiding this comment

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

Can you move cache the result of length - 1 and use that if possible, I know it was already like that but changing it to a local variable would be better for DRY.

@usirin
Copy link
Member

usirin commented Jan 23, 2015

Other than that minor stuff, it LGTM. Thanks for that @alex-ionochkin 👍

@alex-ionochkin
Copy link
Contributor Author

@usirin, thanks for review. I cached length - 1 as you suggested. Please take a look

usirin added a commit that referenced this pull request Jan 26, 2015
…dex-fix

Fix for insertion new item before the last item
@usirin usirin merged commit 4003302 into koding:master Jan 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants