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 = ...@@ -370,13 +370,14 @@ Rivets.binders =
370 block: true 370 block: true
371 371
372 bind: (el) -> 372 bind: (el) ->
373 attr = ['data', @view.config.prefix, @type].join('-').replace '--', '-' 373 unless @marker?
374 @marker = document.createComment " rivets: #{@type} " 374 attr = ['data', @view.config.prefix, @type].join('-').replace '--', '-'
375 @iterated = [] 375 @marker = document.createComment " rivets: #{@type} "
376 376 @iterated = []
377 el.removeAttribute attr 377
378 el.parentNode.insertBefore @marker, el 378 el.removeAttribute attr
379 el.parentNode.removeChild el 379 el.parentNode.insertBefore @marker, el
380 el.parentNode.removeChild el
380 381
381 unbind: (el) -> 382 unbind: (el) ->
382 view.unbind() for view in @iterated if @iterated? 383 view.unbind() for view in @iterated if @iterated?
......