Permalink
Browse files

make rivets do better for #57

  • Loading branch information...
1 parent 7938f1e commit 6f96f1cc296d82c4c346f85a7c9875411b85a1e6 @bolasblack bolasblack committed Oct 8, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/rivets.coffee
View
@@ -272,7 +272,7 @@ iterationBinding = (name) -> (el, collection, binding) ->
binding.iterated = []
- for item in collection
+ itemProcesser = (item) ->
data = {}
data[n] = m for n, m of binding.view.models
data[name] = item
@@ -284,6 +284,11 @@ iterationBinding = (name) -> (el, collection, binding) ->
el: itemEl
view: rivets.bind itemEl, data
+ if collection.map?
+ collection.map itemProcesser
+ else
+ itemProcesser(item) for item in collection
+
# Returns an attribute binding routine for the specified attribute. This is what
# is used when there are no matching routines for an identifier.
attributeBinding = (attr) -> (el, value) ->

0 comments on commit 6f96f1c

Please sign in to comment.