Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make rivets do better for #57

  • Loading branch information...
commit 6f96f1cc296d82c4c346f85a7c9875411b85a1e6 1 parent 7938f1e
@bolasblack bolasblack authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/rivets.coffee
View
7 src/rivets.coffee
@@ -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) ->
Please sign in to comment.
Something went wrong with that request. Please try again.