class window.CheckboxMaster extends window.Behavior

  init: ->
    @$btnGroup = @domData('checkbox-master-btngroup-target')
    @$default = @domData('checkbox-mater-default-button', @getButtons().first())

    @$dom.click =>
      @toggleButtons()

  getButtons: ->
    $("button", @$btnGroup)

  toggleButtons: ->
    @getButtons().each ->
      $button = $(@)
      $button.addClass('active')
      $button.find('input').attr("checked", "checked")
