 # Binds an event handler on the element.
 Rivets.public.binders['on-*'] =
   function: true
+  priority: 1000
 
   unbind: (el) ->
     Rivets.Util.unbindEvent el, @args[0], @handler if @handler

# (negated version of `if` binder).
Rivets.public.binders.unless =
  block: true

  bind: (el) ->
    Rivets.public.binders.if.bind.call @, el

# property when the input is checked or unchecked (two-way binder).
Rivets.public.binders.checked =
  publishes: true
  priority: 2000

  bind: (el) ->
    Rivets.Util.bindEvent el, 'change', @publish

  unbind: (el) ->
    Rivets.Util.unbindEvent el, 'change', @publish

  routine: (el, value) ->
    if el.type is 'radio'
      el.checked = el.value?.toString() is value?.toString()
