8af3c617 by Michael Richards

Implement a custom update callback for the each-* binder. [Closes #183]

1 parent 966fa1ab
...@@ -487,6 +487,14 @@ Rivets.binders = ...@@ -487,6 +487,14 @@ Rivets.binders =
487 else if @iterated[index].models[modelName] isnt model 487 else if @iterated[index].models[modelName] isnt model
488 @iterated[index].update data 488 @iterated[index].update data
489 489
490 update: (models) ->
491 data = {}
492
493 for key, model of models
494 data[key] = model unless key is @args[0]
495
496 view.update data for view in @iterated
497
490 "class-*": (el, value) -> 498 "class-*": (el, value) ->
491 elClass = " #{el.className} " 499 elClass = " #{el.className} "
492 500
......