8d1ea999 by Terrance A. Snyder

each-* will now check for null on null array [Closes #110]

1 parent 835f5406
......@@ -339,17 +339,18 @@ Rivets.binders =
@iterated = []
for item in collection
data = {}
data[n] = m for n, m of @view.models
data[@args[0]] = item
itemEl = el.cloneNode true
if @iterated.length > 0
previous = @iterated[@iterated.length - 1].els[0]
else
previous = @marker
@marker.parentNode.insertBefore itemEl, previous.nextSibling ? null
@iterated.push rivets.bind itemEl, data
if collection
for item in collection
data = {}
data[n] = m for n, m of @view.models
data[@args[0]] = item
itemEl = el.cloneNode true
if @iterated.length > 0
previous = @iterated[@iterated.length - 1].els[0]
else
previous = @marker
@marker.parentNode.insertBefore itemEl, previous.nextSibling ? null
@iterated.push rivets.bind itemEl, data
"class-*": (el, value) ->
elClass = " #{el.className} "
......