-#####
-# On Off Switch Class (Old KDRySwitch)
-#####
-
 class KDOnOffSwitch extends KDInputView
   constructor:(options = {}, data)->
 
     options.type           = "switch"
     options.title        or= ""
     options.size         or= "small"        # a String tiny/small/big
-    options.labels       or= ["ON", "OFF"]
+    options.labels       or= ["ON"  , "OFF"]
     options.defaultValue  ?= off
     super options, data
 


  setDomElement:(cssClass)->
    {title, labels, name} = @getOptions()
    title       = "<span>#{title}</span>" if title
    @inputName  = name
    @domElement = $ """
      <div class='kdinput on-off off #{cssClass}'>

    options.attributes ?= {}
    options.attributes.checked ?= options.defaultValue or no
    super options, data

class KodingSwitch extends KDOnOffSwitch


  constructor:(options = {}, data)->

    options.labels       or= ['', '']
    options.defaultValue  ?= off

    super options, data


  setDomElement:(cssClass)->

    {name} = @getOptions()
    @domElement = $ """
      <div class='kdinput koding-on-off off #{cssClass}'>
        <a href='#' class='on' title='turn on'></a><a href='#' class='off' title='turn off'></a>
      </div>
      """
