3f76c4a6 by Michael Richards

Implement an event handler configuration option, used in the on-* binder's routine. [#161]

1 parent c7af8fd0
...@@ -359,8 +359,10 @@ Rivets.binders = ...@@ -359,8 +359,10 @@ Rivets.binders =
359 "on-*": 359 "on-*":
360 function: true 360 function: true
361 routine: (el, value) -> 361 routine: (el, value) ->
362 Rivets.Util.unbindEvent el, @args[0], @currentListener if @currentListener 362 binding = this
363 @currentListener = Rivets.Util.bindEvent el, @args[0], value, @view 363 Rivets.Util.unbindEvent el, @args[0], @handler if @handler
364 @handler = (ev) -> binding.view.config.handler value, @, ev, binding
365 Rivets.Util.bindEvent el, @args[0], @handler
364 366
365 "each-*": 367 "each-*":
366 block: true 368 block: true
......