c22a01d8 by Michael Richards

Merge pull request #169 from mikeric/fix-rebinding-for-the-each-binder

Fix re-binding for each-* bindings
2 parents 846ef080 945ec9da
......@@ -370,13 +370,14 @@ Rivets.binders =
block: true
bind: (el) ->
attr = ['data', @view.config.prefix, @type].join('-').replace '--', '-'
@marker = document.createComment " rivets: #{@type} "
@iterated = []
el.removeAttribute attr
el.parentNode.insertBefore @marker, el
el.parentNode.removeChild el
unless @marker?
attr = ['data', @view.config.prefix, @type].join('-').replace '--', '-'
@marker = document.createComment " rivets: #{@type} "
@iterated = []
el.removeAttribute attr
el.parentNode.insertBefore @marker, el
el.parentNode.removeChild el
unbind: (el) ->
view.unbind() for view in @iterated if @iterated?
......