e0d736ad by Michael Richards

Add an unbind callback to the each-* binder that unbinds all iterated views. [Closes #153]

1 parent d9c1dbac
...@@ -345,6 +345,8 @@ Rivets.binders = ...@@ -345,6 +345,8 @@ Rivets.binders =
345 block: true 345 block: true
346 bind: (el, collection) -> 346 bind: (el, collection) ->
347 el.removeAttribute ['data', Rivets.config.prefix, @type].join('-').replace '--', '-' 347 el.removeAttribute ['data', Rivets.config.prefix, @type].join('-').replace '--', '-'
348 unbind: (el, collection) ->
349 view.unbind() for view in @iterated if @iterated?
348 routine: (el, collection) -> 350 routine: (el, collection) ->
349 if @iterated? 351 if @iterated?
350 for view in @iterated 352 for view in @iterated
......