4534e9b7 by Adam Heath

Instead of using a coffee 'for' loop to iterate over the collection in

each-*, use a global callback to do the looping.  This will global
function will eventually check the adapter for an overridden version.
1 parent c1e29df4
......@@ -253,6 +253,9 @@ getInputValue = (el) ->
when 'select-multiple' then o.value for o in el when o.selected
else el.value
iterate = (collection, callback) ->
callback item for item in collection
# Core binding routines.
Rivets.binders =
enabled: (el, value) ->
......@@ -337,7 +340,7 @@ Rivets.binders =
@iterated = iterated = []
if collection
for item in collection
iterate collection, (item) =>
data = {}
data[n] = m for n, m of @view.models
data[@args[0]] = item
......