a5a6ad5e by Michael Richards

Implement an eventHandler factory on Rivets.Binding.

1 parent a5e3414f
...@@ -57,6 +57,11 @@ class Rivets.Binding ...@@ -57,6 +57,11 @@ class Rivets.Binding
57 57
58 value 58 value
59 59
60 # Returns an event handler for the binding around the supplied function.
61 eventHandler: (fn) =>
62 handler = (binding = @).view.config.handler
63 (ev) -> handler.call fn, @, ev, binding
64
60 # Sets the value for the binding. This Basically just runs the binding routine 65 # Sets the value for the binding. This Basically just runs the binding routine
61 # with the suplied value formatted. 66 # with the suplied value formatted.
62 set: (value) => 67 set: (value) =>
......