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.
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -253,6 +253,9 @@ getInputValue = (el) -> | ... | @@ -253,6 +253,9 @@ getInputValue = (el) -> |
253 | when 'select-multiple' then o.value for o in el when o.selected | 253 | when 'select-multiple' then o.value for o in el when o.selected |
254 | else el.value | 254 | else el.value |
255 | 255 | ||
256 | iterate = (collection, callback) -> | ||
257 | callback item for item in collection | ||
258 | |||
256 | # Core binding routines. | 259 | # Core binding routines. |
257 | Rivets.binders = | 260 | Rivets.binders = |
258 | enabled: (el, value) -> | 261 | enabled: (el, value) -> |
... | @@ -337,7 +340,7 @@ Rivets.binders = | ... | @@ -337,7 +340,7 @@ Rivets.binders = |
337 | @iterated = iterated = [] | 340 | @iterated = iterated = [] |
338 | 341 | ||
339 | if collection | 342 | if collection |
340 | for item in collection | 343 | iterate collection, (item) => |
341 | data = {} | 344 | data = {} |
342 | data[n] = m for n, m of @view.models | 345 | data[n] = m for n, m of @view.models |
343 | data[@args[0]] = item | 346 | data[@args[0]] = item | ... | ... |
-
Please register or sign in to post a comment