Browse files

insert in proper place

  • Loading branch information...
1 parent 0601612 commit abdeee6419ab7c28d8d4a2eb5af209dc102d7d64 @jsmarkus committed Nov 29, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 ListView.coffee
View
8 ListView.coffee
@@ -45,8 +45,8 @@ module.exports = ({backbone, knockout})->
collectionToVm : (collection)->
@modelToVm m for m in collection.models
- onCollectionAdd:(model, collection)=>
- @vmInsert model
+ onCollectionAdd:(model, collection, {at, index})=>
+ @vmInsert model, index
onCollectionRemove:(model, collection)=>
@vmRemove model
@@ -60,8 +60,8 @@ module.exports = ({backbone, knockout})->
onCollectionClear:(collection)=>
@vmClear()
- vmInsert : (model)->
- @vm.items.push @modelToVm model
+ vmInsert : (model, index)->
+ @vm.items.splice index, 0, @modelToVm model
vmClear : ->
@vm.items []
vmReset : (collection)->

0 comments on commit abdeee6

Please sign in to comment.