updateAfterChange: ->
@updateHidden()
@updateButtons()
updateHidden: ->
values = (option.value for option in @selected.element.options)
@hidden.value JSON.stringify values
bindEvents: ->
@container.on "change", "select", =>
@updateButtons()
return false
@select.on "click", =>
@doSelect()
return false
@available.on "dblclick", =>
@doSelect()
return false
@deselect.on "click", =>
@doDeselect()
return false
@selected.on "dblclick", =>
@doDeselect()
return false
if @reorder
@moveUp.on "click", =>
@doMoveUp()
return false
@moveDown.on "click", =>
@doMoveDown()
return false