   
   getCallback:()-> @buttonCallback
   
-  # setName:(name)->
-  #   @$().attr {name}
-  # 
-  # setValue:(value)->
-  #   @$().attr {value}
-  
   unhideIcon:()->
     @setClass "with-icon"
     @$('span.icon').removeClass 'hidden'
   
   
-  # refactor this
-  # this seems unnecessary just use cssClass maybe
-  setButtonStyle:(newStyle)->
-    {styles} = @constructor
-    for style in styles
-      @getDomElement().removeClass style
-    @getDomElement().addClass newStyle
-
   setIconClass:(iconClass)->
     @$('.icon').attr 'class','icon'
     @$('.icon').addClass iconClass

class KDButtonView extends KDView

  @styles = [
    "minimal","clean-gray","cupid-green","cupid-blue","blue-pill"
    "dribbble","slick-black","thoughtbot","blue-candy","purple-candy"
    "shiny-blue","small-blue","skip","clean-red","small-gray","transparent"
  ]

  constructor:(options = {},data)->
    options = $.extend
      callback     : noop          # a Function
      title        : ""            # a String
      style        : "clean-gray"  # a String of one of button styles
      type         : "button"      # a String of submit, reset, button
      cssClass     : ""            # a String
      icon         : no            # a Boolean value
      iconOnly     : no            # a Boolean value
      iconClass    : ""            # a String  
      disabled     : no            # a Boolean value
      hint         : null          # a String of HTML ---> not yet implemented
      loader       : no
      # name         : ""
      # value        : ""
    ,options
    
    super options,data

    @setCallback options.callback
    @setTitle options.title
    @setButtonStyle options.style
    # @setName options.name           if options.name
    # @setValue options.value         if options.value
    @setIconClass options.iconClass if options.iconClass
    @unhideIcon()                   if options.icon
    @setIconOnly options.iconOnly   if options.iconOnly

      @listenTo 
        KDEventTypes       : "viewAppended"
        listenedToInstance : @
        callback           : -> @setLoader()
    

  setDomElement:(cssClass)->
    @domElement = $ """
      <button type='#{@getOptions().type}' class='kdbutton #{cssClass}' id='#{@getId()}'>
        <span class='icon hidden'></span>
        <span class='button-title'>Title</span>
      </button>
