Skip to content

Commit

Permalink
Hide the initial element (reference + marker) in the iteration binding.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeric committed Aug 9, 2012
1 parent 29a0906 commit a91cc22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rivets.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ eventBinding = (event) -> (el, bind, unbind) ->

# Returns an iteration binding routine for the specified collection.
iterationBinding = (name) -> (el, collection, binding) ->
Rivets.routines.hide el, true

for iteration in binding.iterated
iteration.view.unbind()
iteration.el.parentNode.removeChild iteration.el
Expand All @@ -203,6 +205,7 @@ iterationBinding = (name) -> (el, collection, binding) ->
data[name] = item

itemEl = el.cloneNode true
Rivets.routines.show itemEl, true
el.parentNode.insertBefore itemEl, el

binding.iterated.push
Expand Down

0 comments on commit a91cc22

Please sign in to comment.