Implement an eventHandler factory on Rivets.Binding.
Showing
1 changed file
with
5 additions
and
0 deletions
... | @@ -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) => | ... | ... |
-
Please register or sign in to post a comment