f299a825 by Adam Heath

The iterate processor now passes the item index to the callback.

1 parent 4534e9b7
...@@ -254,7 +254,7 @@ getInputValue = (el) -> ...@@ -254,7 +254,7 @@ getInputValue = (el) ->
254 else el.value 254 else el.value
255 255
256 iterate = (collection, callback) -> 256 iterate = (collection, callback) ->
257 callback item for item in collection 257 callback item, i for item, i in collection
258 258
259 # Core binding routines. 259 # Core binding routines.
260 Rivets.binders = 260 Rivets.binders =
...@@ -340,7 +340,7 @@ Rivets.binders = ...@@ -340,7 +340,7 @@ Rivets.binders =
340 @iterated = iterated = [] 340 @iterated = iterated = []
341 341
342 if collection 342 if collection
343 iterate collection, (item) => 343 iterate collection, (item, i) =>
344 data = {} 344 data = {}
345 data[n] = m for n, m of @view.models 345 data[n] = m for n, m of @view.models
346 data[@args[0]] = item 346 data[@args[0]] = item
......