Add an unbind function to the on-* binder so that it's event handler is removed when unbinding.
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -358,6 +358,10 @@ Rivets.binders = | ... | @@ -358,6 +358,10 @@ Rivets.binders = |
358 | 358 | ||
359 | "on-*": | 359 | "on-*": |
360 | function: true | 360 | function: true |
361 | |||
362 | unbind: (el) -> | ||
363 | Rivets.Util.unbindEvent el, @args[0], @handler if @handler | ||
364 | |||
361 | routine: (el, value) -> | 365 | routine: (el, value) -> |
362 | binding = this | 366 | binding = this |
363 | Rivets.Util.unbindEvent el, @args[0], @handler if @handler | 367 | Rivets.Util.unbindEvent el, @args[0], @handler if @handler | ... | ... |
-
Please register or sign in to post a comment