Implement a custom update callback for the each-* binder. [Closes #183]
Showing
1 changed file
with
8 additions
and
0 deletions
... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment